[material-ui][Text Field] Typing Japanese Characters skips and displays only 2nd characters #39100
Closed
2 tasks done
Labels
component: text field
This is the name of the generic UI component, not the React module!
package: material-ui
Specific to @mui/material
status: waiting for author
Issue with insufficient information
Duplicates
Latest version
Steps to reproduce 🕹
Link to live example:
Steps:
1.Create a react component function and add material UI Textfield
2.Create a useState function and array object. (ex. const [test, setTest] = React.useState([]);)
3. Create a function to be called for onChange event. (ex. const onChange = (e)=>{setTest([])})
4.On Material-UI Textfield, edit the onChange property and call the onChange variable created on #3
5. Run this and you will see, first character is skipped and only alternating characters are converted to japanese. (ex. bあkあrいtえsうtお)
Current behavior 😯
first character is skipped and only alternating characters are converted to japanese. (ex. bあkあrいtえsうtお)
Expected behavior 🤔
this should convert the syllables into corresponding Japanese characters (ex. ばかりテスト)
Context 🔦
resetting the value of a state array or state object/json inside the onChange envent will break the TextField function.
If you have this:
const [test, setTest] = React.useState([]);
const [testObj, setTestObj] = React.useState({});
Then inside the onChange function, you put this:
setTest([]) or setTestObj({})
will cause the issue with Japanese Characters.
Your environment 🌎
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: