Skip to content

Textfield seems not working properly in iOS when input is not English #153

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

Open
cht8687 opened this issue Jul 29, 2020 · 9 comments
Open
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@cht8687
Copy link

cht8687 commented Jul 29, 2020

Hi team, great library.
I just noticed Textfield seems functioning abnormally when typing in other languages:
(it seems will accept all the letters typed by the user)

1

@cht8687 cht8687 changed the title Textfield seems not working proper in other languages Textfield seems not working properly in other languages Jul 29, 2020
@cht8687 cht8687 changed the title Textfield seems not working properly in other languages Textfield seems not working properly in Safari when typing in other languages Jul 29, 2020
@cht8687 cht8687 changed the title Textfield seems not working properly in Safari when typing in other languages Textfield seems not working properly in iOS when input is not English Jul 29, 2020
@cht8687
Copy link
Author

cht8687 commented Jul 30, 2020

@hperrin

After some research, I found after remove this line, the issue is gone:
https://github.com/hperrin/svelte-material-ui/blob/master/packages/textfield/Input.svelte#L39

The main reason is that, we need to ignore update the value when e.insertType is insertCompositionText
only update the value when e.insertType is insertComposition.

I am not really sure what's the impact to remove this line and wondering if we can put some logic for above in
some other places.

@cht8687
Copy link
Author

cht8687 commented Jul 30, 2020

@hperrin
please check this PR and see if it is a proper fix:

#154

@hperrin
Copy link
Owner

hperrin commented Aug 5, 2020

Thank you for the research. I'm not familiar with the e.insertType here. How can I test this?

@hperrin
Copy link
Owner

hperrin commented Aug 5, 2020

Possibly we could introduce a fix on line 67, where the input var is updated from the input event.

@cht8687
Copy link
Author

cht8687 commented Aug 5, 2020

@hperrin

I debugged and found this line

    valueProp.value = value === undefined ? '' : value;

assigned unnecessary value to the input field. ( see the PR)

in the on: input event, you can capture the input type

on:input={updateInputType}

function updateInputType(e) {
console.log( e.inputType)
}


You can install Japanese or Chinese input on your machine to test this.

@cht8687
Copy link
Author

cht8687 commented Aug 5, 2020

Here are the same issue found in other libraries which has same issue, hope this gives you some more info around this area.
I am not so familiar with our codebase yet to have a more comprehensive fix.

bootstrap-vue/bootstrap-vue#2104

@shinyaohira
Copy link

I have the same problem.

@hperrin hperrin self-assigned this Nov 10, 2021
@hperrin hperrin added bug Something isn't working help wanted Extra attention is needed labels Nov 10, 2021
@hperrin
Copy link
Owner

hperrin commented Nov 10, 2021

I'm aware this is still an issue, and I'd like help solving it, because I don't know how to test it as I can't input any other languages.

@cht8687
Copy link
Author

cht8687 commented Nov 10, 2021

This PR should resolve it. (at least working for me... :) )
#154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants