-
Notifications
You must be signed in to change notification settings - Fork 86
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
fix expandable search bar issue w/ the dropdown options (quick search) #553
fix expandable search bar issue w/ the dropdown options (quick search) #553
Conversation
Codecov Report
@@ Coverage Diff @@
## master #553 +/- ##
=======================================
Coverage 97.64% 97.64%
=======================================
Files 98 98
Lines 1825 1828 +3
Branches 169 170 +1
=======================================
+ Hits 1782 1785 +3
Misses 43 43
Continue to review full report at Codecov.
|
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.
I tested the branch and the functionality looks good except for focusing the search box after clearing. Update that and add the return type to updated()
and this PR should be good to go.
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.
Looks good! Thank you for the fix!
Description
This PR addresses issue #528. The issue was actually broader than described. The expandable search bar was actually unable to use the dropdown options after any user input keystrokes. This PR fixes that and it now works as intended.
Technical
The existing code didn't work because it tried to modify a LitElement component from outside the component. LitElement, like similar frameworks, updates the DOM based on changes to state inside components. Also, the previous implementation placed a non-documented obligation on the consumer to know that they must write this supporting code.
This implementation fixes this by changing state from within the component.
I also would like to note that I discovered another pre-existing problem while fixing this, but that goes beyond the scope of this PR. Both
this.searchTerm
andthis.searchInput.value
hold overlapping state information for text in the search bar. I tried to see if there was a simple fix by looking at LitElement's documentation, but it seemed like it would take more digging or someone with more experience with that framework. A simple solution might be converting this to React. I can file an issue if need be.Testing
See if the expandable search bar correctly takes new input after from the drop-down menu/the expandable search bar works in general.
Evidence
iaux_expandable_search_fix_demo.mov