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

Option to remove input text selection on click of an input #27

Open
JoeDMitchell opened this issue Nov 13, 2019 · 1 comment
Open

Option to remove input text selection on click of an input #27

JoeDMitchell opened this issue Nov 13, 2019 · 1 comment

Comments

@JoeDMitchell
Copy link

When you click an input it auto selects the text inside of it. This means on mobile a context menu is shown (allowing copy and paste e.t.c) which is very annoying for a user. Can we have an option to disable this text selection?

@pimschaaf
Copy link

pimschaaf commented Jun 1, 2020

This is not a solution, but you can blur() the input.

I found that both .on('change') and .on('selection') fire too early though, requiring something like the following as a workaround:

combobo.on('selection', function() {
  setTimeout(function() {
    $('#combobox').blur();
  }, 1);
});

This still allows for a split second of text selection. Also, as it blurs the input, the user will need to tab back to change the selection.

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