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

Cursor is placed in wrong place when text is already present in input #17

Open
sheerun opened this issue Feb 7, 2020 · 3 comments
Open

Comments

@sheerun
Copy link

sheerun commented Feb 7, 2020

Steps to reproduce:

  1. Write some text in input
  2. Place text cursor in the middle of text
  3. Defocus input by clicking outside
  4. Click again on input trying to place text cursors somewhere else

Current behavior:

Text cursor is placed in original location, in the middle

Expected behavior:

Text cursor is placed where mouse cursor clicked

Here's git showing this behavior:

https://giphy.com/gifs/hosFDTCEf9Zhldlf7O

@Mwni
Copy link
Owner

Mwni commented Feb 7, 2020

This is a tricky one. The html input is hidden when substituted. A mousedown on the substituted pixi-text switches the visibility to the html input. however, for the cursor to be set correctly, the input would've had to be visible before that mousedown occured. i'll have check if it's possible to trigger a synthetic copy of that exact mousedown event on the html input, and if that will actually set the cursor position.

@sheerun
Copy link
Author

sheerun commented Feb 7, 2020 via email

@Mwni
Copy link
Owner

Mwni commented Feb 7, 2020

Well if that's an option for you.
Set input.substituteText = false
Keep in mind placing things above it will not be possible with that setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants