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

[material-ui][Text Field] Typing Japanese Characters skips and displays only 2nd characters #39100

Closed
2 tasks done
dennisadriano18 opened this issue Sep 22, 2023 · 2 comments
Closed
2 tasks done
Assignees
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

Comments

@dennisadriano18
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the 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
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.
@dennisadriano18 dennisadriano18 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 22, 2023
@danilo-leal danilo-leal changed the title Material-UI TextField: Typing Japanese Characters skips and displays only 2nd characters. [material-ui][Text Field] Typing Japanese Characters skips and displays only 2nd characters Sep 22, 2023
@danilo-leal danilo-leal added component: text field This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material labels Sep 22, 2023
@mj12albert
Copy link
Member

@dennisadriano18 Could you provide a repro? You can fork this template: https://mui.com/r/issue-template-latest

PS: here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

@mj12albert mj12albert added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 3, 2023
@github-actions
Copy link

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants