patternfly-react icon indicating copy to clipboard operation
patternfly-react copied to clipboard

bug(Select): 'view more' feature is problematic when used with the typeahead variant

Open KKoukiou opened this issue 4 years ago • 3 comments

Describe the issue. What is the expected and unexpected behavior?

  • onSelect should provide the information if an option is isLoad (View more) the same way it does for the isPlaceholder View more should be handled by the consumers in a special way, not like a normal SelectOption.

  • Clicking View more twice in a row crashes the component with; this.refCollection[this.state.viewMoreNextIndex][0] is undefined

Please provide the steps to reproduce. Feel free to link CodeSandbox or another tool.

https://codesandbox.io/s/eager-wind-eqq1j?file=/index.js

Is this a bug or enhancement? If this issue is a bug, is this issue blocking you or is there a work-around? bug

KKoukiou avatar Sep 28 '21 16:09 KKoukiou

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Nov 30 '21 21:11 stale[bot]

Not stale; still a bug.

garrett avatar Dec 01 '21 09:12 garrett

It doesn't look like isLoad is the culprit. I am assuming the behavior has changed since the component now crashes after a single click.

In any case clicking "View More" causes componentDidUpdate to execute twice. Problem is that the first time it's executed the new items aren't part of the refCollection yet (only when using typeahead). Putting a null-check on the focus will make it work but I don't know if that's a proper fix.

michpetrov avatar Dec 03 '21 12:12 michpetrov

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Sep 09 '23 22:09 stale[bot]