-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
#594 and #589 Fixes navigation issues with non-searchable controls #595
Conversation
Looks good, thanks @MrLeebo! |
Hi guys this doesn't seem quite right to me? |
@azaharakis @JedWatson Wouldn't it be easier to just delete that line? |
@azaharakis I'm not opposed to what you're suggesting, I just put up a PR to do the simplest fix so in the mean time there isn't a lingering issue with multi controls. |
@MrLeebo, I think you're right. I'm new to the codebase, and my initial thought was the final creation of the input props was being done to late, and could reduce duplication by creating the props that get rendered into the input on creation of the control. I'll need to play around a bit more to understand all the options, and if they are required. |
Testing this fix, i've notice some different issues occurring now. The input field thats created in these dropdowns doesn't have a variable width and causes its container to have a min-width of around 150px depending on how you have setup your sass/less. It also means that there is a cursor thats visible on mobile devices in these select boxes as well as creating large white spaces as it drops down to the next line if it doesn't fit. |
Those were non-issues when it was a |
Sorry for the delay - I've been travelling. Just merged @MrLeebo's second PR, I need to look into this more closely but for the moment I think this makes it better. |
This essentially reverts the change made here JedWatson#595 By applying a tabIndex on a div element allows it to be focused. This was the reason the div was changed to an input, by putting it back to a div mobile devices display consistent behaviour when the select box recieves focus. IOS would display a chrome at the bottom of the page where as chrome wouldn't.
Issue: #594 and #589
For non-searchable controls, I replaced the placeholder
<div/>
with a readonly<input/>
that has a tabIndex and onfocus / onblur callbacks. It receives keyboard navigation and closes when you click the mouse outside of the control.I added autocomplete and type="search" because my LastPass extension kept trying to treat the input as a password for some reason (not sure why this wasn't happening in searchable controls), so there's probably a smarter way to do that.