Android webview, select opens and immediately closes
See original GitHub issueThis was brought to our attention when a user was using react-select through Facebooks in app browser. I’ve managed to replicate the issue on Android 4.3 using webview. Works great everywhere else, but many users accessing links via Facebook, this could be an issue.
Basic config:
<Select
ref='input'
name={this.props.name}
onChange={this.onChange.bind(this)}
onFocus={this.onFocus.bind(this)}
options={this.props.options}
asyncOptions={this.asyncOptions}
disabled={this.props.disabled}
value={this.props.value}
placeholder={this.props.placeholder}
optionRenderer={(option) => {
return (<div className={classes.ungroupedItem}>{option.label}</div>);
}}
searchable={false}
clearable={false}
cache={{}}
/>
If I edit lib/Select.js within the package directly and modify handleMouseDownOnArrow, handleMouseDownOnMenu and handleMouseDown and add the touchend event :
if (this.props.disabled || [‘mousedown’, ‘touchend’].indexOf(event.type) !== -1 && event.button !== 0) {return;}
This works.
Any thoughts on how to achieve this without modifying the package? I add onOpen and OnClose props and with on touch on the <Select>, both these functions were triggered.
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
Here's how to fix those mysterious Android WebView crashes
Updated WebView app should fix crashes ... Close. Tap the three-dot menu at the top right of this screen, then select "Uninstall updates....
Read more >Trying to open SELECT tag in Android WebView crashes the ...
It crashes because you have given ApplicationContext to the webview. When a SELECT tag is clicked, Android internally displays its options ...
Read more >obsolete - Issue Tracker - Google
Using WebView. when selecting any text the app will crash while attempting to create the action mode menu. Other notes: Issue is not ......
Read more >Android System WebView - Apps on Google Play
Android WebView is a pre-installed system component from Google that allows Android apps to display web content. Updated on. Dec 13, 2022.
Read more >WebView DevTools user guide
Note: Some types of crashes such as renderer crashes can show up instantly in the UI. However, most WebView crashes will require relaunching...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I tried a workaround for this issue by triggering the focus to
Select
component from another element and overlapping it precisely on top of the actualSelect
component.First, I needed to bind the
Select
component using ref and then make a function to focus on theSelect
and to control the menu withmenuIsOpen
props:As for the layout, I wrapped the
Select
component with a div, and then I added child element beforeSelect
component and also passingopenMenu
state intomenuIsOpen
props; that would look like this:In this case, I used text input because the
Select
component would work if I click on a regular html text input first before focusing/clicking onSelect
. For the hidden input styling, since it needs to be overlapping theSelect
component, the css would be:I would like the text input that triggers the focus on
Select
component to not get in the way of the UI while still being on top of the actualSelect
, hence why I set the opacity to 0.I hope this would help.
Hi @yocokirk,
In an effort to sustain the react-select project going forward, we’re cleaning up and closing old issues and pull requests.
We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our efforts towards the current major version.
If you aren’t using the latest version of react-select please consider upgrading to see if it resolves any issues you’re having.
However, if you feel this issue is still relevant and you’d like us to review it - please leave a comment and we’ll do our best to get back to you!