You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.
Hi,
the documentation for a custom renderLanguageSelect describes the onChange method with a parameter for selectedValue.
onChange: (selectedValue: string)=>void,
But as you can see in the code component, the onChange method requires an event handler. It calls preventDefault, stopPropagation and access the value through ev.currentTarget.value (line 44).
I have worked around this by calling onChange with a fake event with noops for the two methods and the newly selectedValue nested in currentTarget.value. So for now it is not a big problem, and maybe it helps other people to implement an own language selector which doesn't depends on a select input.
createChangeLanguageHandler: ({ onChange })=>newValue=>{// call onChange with a fake eventonChange({preventDefault: ()=>{},stopPropagation: ()=>{},currentTarget: {value: newValue},});}
Please update the documentation or improve the onChange handler to work as described.
Keep up your good work! Cheers 🍻️
The text was updated successfully, but these errors were encountered:
dino115
changed the title
Documentation for renderLanguageSelect inaccurate
Documentation for renderLanguageSelect is inaccurate
Jun 23, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
the documentation for a custom
renderLanguageSelect
describes theonChange
method with a parameter for selectedValue.But as you can see in the code component, the onChange method requires an event handler. It calls
preventDefault
,stopPropagation
and access the value throughev.currentTarget.value
(line 44).I have worked around this by calling
onChange
with a fake event with noops for the two methods and the newly selectedValue nested incurrentTarget.value
. So for now it is not a big problem, and maybe it helps other people to implement an own language selector which doesn't depends on a select input.Please update the documentation or improve the onChange handler to work as described.
Keep up your good work! Cheers 🍻️
The text was updated successfully, but these errors were encountered: