Open AdrienJacquard opened 9 months ago
Hi! Thanks for the bug report. This appears to be a bug in WebKit, probably this one. (Text doesn't get/stay focused when using .select()
on a text field in Safari.)
Thank you for your feedback @mapsandapps but are you sure it's the same issue ? Cause if I don't use the ion-textarea
component and use textarea
instead it work as expected OR if I wrap my select with a setTimeout
of 50 ms it also work.
Exemple:
public selectText(): void {
setTimeout(() => {
this.textArea.getInputElement().then((input) => input.select());
}, 50);
}
Could it not be a race condition ? As you can see on demo provided above when clicking in the input it briefly select all of the text for a very brief moment. And then unselect. Your webkit issue don't mention that and instead mention that it is never focus.
cc: @cconti1
Hello @mapsandapps, can we have that one review one more time by any chance ? I don't believe it's an external bug since the WebKit you provided above is not really related, thanks.
Hi @AdrienJacquard,
I'm able to reproduce this with the native textarea
without Ionic Framework. You can take a look at this stackblitz and see that the issue reproduces in Safari but not Chrome.
Prerequisites
Ionic Framework Version
v6.x, v7.x
Current Behavior
Expected Behavior
Steps to Reproduce
Code Reproduction URL
https://stackblitz.com/edit/ionic-textarea-select
Ionic Info
Additional Information
No response