@patternfly/react-core 4.222.0 → 4.222.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7527,21 +7527,28 @@
7527
7527
  this.refCollection[this.state.viewMoreNextIndex][0].focus();
7528
7528
  this.setState({ viewMoreNextIndex: -1 });
7529
7529
  }
7530
+ const checkUpdatedChildren = (prevChildren, currChildren) => prevChildren.some((prevChild, index) => {
7531
+ const prevChildProps = prevChild.props;
7532
+ const currChild = currChildren[index];
7533
+ const { props: currChildProps } = currChild;
7534
+ if (prevChildProps && currChildProps) {
7535
+ return (prevChildProps.value !== currChildProps.value ||
7536
+ prevChildProps.label !== currChildProps.label ||
7537
+ prevChildProps.isDisabled !== currChildProps.isDisabled ||
7538
+ prevChildProps.isPlaceholder !== currChildProps.isPlaceholder);
7539
+ }
7540
+ else {
7541
+ return prevChild !== currChild;
7542
+ }
7543
+ });
7530
7544
  const hasUpdatedChildren = prevProps.children.length !== this.props.children.length ||
7531
- prevProps.children.some((prevChild, index) => {
7532
- const prevChildProps = prevChild.props;
7533
- const currChild = this.props.children[index];
7534
- const { props: currChildProps } = currChild;
7535
- if (prevChildProps && currChildProps) {
7536
- return (prevChildProps.value !== currChildProps.value ||
7537
- prevChildProps.label !== currChildProps.label ||
7538
- prevChildProps.isDisabled !== currChildProps.isDisabled ||
7539
- prevChildProps.isPlaceholder !== currChildProps.isPlaceholder);
7540
- }
7541
- else {
7542
- return prevChild !== currChild;
7543
- }
7544
- });
7545
+ checkUpdatedChildren(prevProps.children, this.props.children) ||
7546
+ (this.props.isGrouped &&
7547
+ prevProps.children.some((prevChild, index) => prevChild.type === SelectGroup &&
7548
+ prevChild.props.children &&
7549
+ this.props.children[index].props.children &&
7550
+ (prevChild.props.children.length !== this.props.children[index].props.children.length ||
7551
+ checkUpdatedChildren(prevChild.props.children, this.props.children[index].props.children))));
7545
7552
  if (hasUpdatedChildren) {
7546
7553
  this.updateTypeAheadFilteredChildren(prevState.typeaheadInputValue || '', null);
7547
7554
  }