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

Focus formatting change interferes with cursor insertion or selection #11

Open
boxofrox opened this issue Jan 14, 2016 · 1 comment
Open

Comments

@boxofrox
Copy link

Steps to reproduce:

  1. Visit demo page.
  2. Interact with Standard integer with formatting field as follows:
    1. Unfocus the field.
    2. Observe the value is 1,500,000.
    3. Click between the comma and the hundreds place.
    4. Observe that when the input field switches to edit mode, the cursor blinks between the hundreds and tens place.

On same page and Standard integer with formatting field:

  1. Unfocus the field.
  2. Observe the value is 1,500,000.
  3. Attempt to select/highlight 500 by click-dragging the mouse.
  4. Observe that the selection highlight in the focused field (edit mode) starts after the 5.

Possible Solution

Not sure how to fix this. Maybe this way?

When user clicks on formatted field,
determine location of cursor in formatted value,
map location of cursor to unformatted value.  something like...

    1 , 5 0 0 , 0 0 0       formatted value
   │ └─┤ │ │ ├─┘ │ │ │
   └─┐ │ │ │ │ ┌─┘ │ │
     │ │ │ │ │ │ ┌─┘ │
     │ │ │ │ │ │ │ ┌─┘
      1 5 0 0 0 0 0         unformatted value (edit mode)

each side of a comma would map to the same edit-mode cursor location.

And something similar with the selection issue, though I imagine if the cursor starts at the correct position in edit mode kicks in, then dragging the selection highlight would Just Work™ without further effort.

@hongymagic hongymagic self-assigned this Jan 15, 2016
@hongymagic
Copy link
Owner

I was hoping to avoid using any Range and Selection API, but it seems like we need to use them. I will try and work on it sometime soon, thanks for reporting this issue.

@hongymagic hongymagic added this to the v15.1.0 milestone May 4, 2016
@hongymagic hongymagic removed their assignment May 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants