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

Selected value is unselected when a cursor fix is triggered #114

Open
lordazzi opened this issue Jun 14, 2018 · 1 comment
Open

Selected value is unselected when a cursor fix is triggered #114

lordazzi opened this issue Jun 14, 2018 · 1 comment

Comments

@lordazzi
Copy link

In input.service.ts:

image

I think you must maintain the cursor end position if it is different of the cursor start position and major the prefix length.
In my project, when I select an input the value must be fully select to help the user change it easily, but the library kills the selection when focus comes from keyboard interaction.

@cwillwer
Copy link

Yes, this is definitely still broken after all these years. It is easily reproducible by creating 3 textboxes, the first with no prefix or suffix, the second with a suffix, and the third with a prefix.

<input type="text" currencyMask [options]="{ prefix:'', suffix: '' }" value="1000" >
<input type="text" currencyMask placeholder="%" [options]="{ prefix:'', suffix: '%' }" value="100%" >
<input type="text" currencyMask placeholder="$" [options]="{ prefix:'$', suffix: '' }" value="1000" >

When you press the tab key to move through each textbox, you will find that the first 2 select the entire contents, which allows the user to type immediately replacing the entire value. However, when you tab into the last box, the cursor is placed right after the '$' preventing the user from replacing the entire value. Aside from being an inconsistent behavior, it is poor UX to force the customer to manually remove an entire value in order to enter a completely different value.

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