-
Notifications
You must be signed in to change notification settings - Fork 4.1k
fix(Dropdown): UX behavior of selectedItems and scroll for filtered options. #2375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
francoiscote
wants to merge
11
commits into
Semantic-Org:master
from
francoiscote:fix/dropdown-search-selected-item
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
073eb6f
fix(Dropdown): setSelectedIndex on open
francoiscote bb860f3
fix(Dropdown): remove useless scroll in open handler. this is handled…
francoiscote 466d48d
fix(Dropdown): scrollSelectedItemIntoView when changing searchQuery
francoiscote 2b0279c
fix tests, simplify setSelectedIndex/scrollSelectedItemIntoView
levithomason 28bbf25
add failing dropdown test for selectedIndex/no results
levithomason 3080331
merge master, fix conflicts
levithomason 0813a69
Merge branch 'master' into fix/dropdown-search-selected-item
levithomason 7c67340
fix(Dropdown): close on document with !closeOnBlur
levithomason 2c9bffd
merge master, with conflict fixes
francoiscote 7855cb2
Merge branch 'master' of https://github.com/Semantic-Org/Semantic-UI-…
layershifter b39b782
restore irrelevant changes
layershifter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line isn't working really. I noted that once you added describe.only, the call domEvent.click(document) isn't really working, and would also cause a failure in the test
closes on click outside
because it uses the same call. If you usedocument.body.click()
(like the testblurs the Dropdown node on close by clicking outside component
) ordomEvent.click(document.body)
then things start working. What this causes though is a call tocloseOnDocumentClick
, which causes the dropdown menu to close, but the focus is still on the input and the input search text is never cleared. In this case, this is correct behavior, since the menu has been closed, but focus is still on the input, so the invalid search text should not be removed. What the test should be doing is calling thehandleBlur
function which is what you're trying to test with this test case. In summary,blurs the Dropdown node on close by clicking outside component
case. May need to include another button element to throw the focus to cause a blur to happen.