@patternfly/react-core 4.224.0 → 4.224.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,30 +7527,32 @@
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;
7530
+ if (this.props.variant === 'typeahead' || this.props.variant === 'typeaheadmulti') {
7531
+ const checkUpdatedChildren = (prevChildren, currChildren) => Array.from(prevChildren).some((prevChild, index) => {
7532
+ const prevChildProps = prevChild.props;
7533
+ const currChild = currChildren[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
+ const hasUpdatedChildren = prevProps.children.length !== this.props.children.length ||
7546
+ checkUpdatedChildren(prevProps.children, this.props.children) ||
7547
+ (this.props.isGrouped &&
7548
+ Array.from(prevProps.children).some((prevChild, index) => prevChild.type === SelectGroup &&
7549
+ prevChild.props.children &&
7550
+ this.props.children[index].props.children &&
7551
+ (prevChild.props.children.length !== this.props.children[index].props.children.length ||
7552
+ checkUpdatedChildren(prevChild.props.children, this.props.children[index].props.children))));
7553
+ if (hasUpdatedChildren) {
7554
+ this.updateTypeAheadFilteredChildren(prevState.typeaheadInputValue || '', null);
7542
7555
  }
7543
- });
7544
- const hasUpdatedChildren = prevProps.children.length !== this.props.children.length ||
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))));
7552
- if (hasUpdatedChildren) {
7553
- this.updateTypeAheadFilteredChildren(prevState.typeaheadInputValue || '', null);
7554
7556
  }
7555
7557
  // for menus with favorites,
7556
7558
  // if the number of favorites or typeahead filtered children has changed, the generated