Skip to content
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

Dropdown: resize search on change #371

Merged
merged 1 commit into from
Aug 4, 2016
Merged

Conversation

levithomason
Copy link
Member

@levithomason levithomason commented Aug 4, 2016

Fixes #370. The search input has a short fixed width that truncates the value. This PR resizes the Dropdown search input on change. SUI css allows for a span.sizer child to measure the search input width. We use this to perform the same resizing as the SUI Dropdown module, but in vanilla JS.

@codecov-io
Copy link

codecov-io commented Aug 4, 2016

Current coverage is 92.66% (diff: 100%)

Merging #371 into master will increase coverage by 0.06%

@@             master       #371   diff @@
==========================================
  Files            63         63          
  Lines           811        818     +7   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            751        758     +7   
  Misses           60         60          
  Partials          0          0          

Powered by Codecov. Last update 2aff2f4...df75f73

this.setState({
selectedIndex: 0,
searchQuery: newQuery,
searchWidth,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no newQuery (search text) then this value will be undefined so the width removed instead of set to 0.

@levithomason levithomason force-pushed the fix/dropdown-search-width branch from 31bba69 to df75f73 Compare August 4, 2016 18:39
@dvdzkwsk
Copy link
Member

dvdzkwsk commented Aug 4, 2016

👻

@levithomason levithomason merged commit 1b3f10a into master Aug 4, 2016
@levithomason levithomason deleted the fix/dropdown-search-width branch August 4, 2016 18:56
@levithomason levithomason changed the title Resize Dropdown search on change Dropdown: resize search on change Aug 18, 2016
@levithomason levithomason restored the fix/dropdown-search-width branch August 23, 2016 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dropdown (multiple) search box does not grow with input
3 participants