CanvasInput icon indicating copy to clipboard operation
CanvasInput copied to clipboard

When I press home key, if the text is bigger that the input, the displayed text doesn't go to home.

Open jalesmonteiro opened this issue 9 years ago • 1 comments

jalesmonteiro avatar Jun 14 '15 18:06 jalesmonteiro

When the full string in the invisible input box does not fit in the visible CanvasInput and one of the following occurs:

*Cmd+Arrow / Home / End key text cursor navigation *Arrow key text cursor navigation *Repositioning text cursor with mouse click *Refocusing on CanvasInput with mouse click

What would be visible in the invisible input box and what is actually visible in the CanvasInput get out of sync. In each of these cases, any edits a user makes to the string will have unexpected results. This is because the clipText function assumes that only the last characters of the oversized string should ever be displayed.

For instance, when the input loses focus, the invisible DOM input's 'visible' text shifts to display only the beginning of the oversized string. Clicking the CanvasInput at this point would place the cursor somewhere in that first chunk of the string, but the cursor would appear to be somewhere in the last chunk of the string.

okaybenji avatar Aug 25 '15 14:08 okaybenji