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

Select() selects all text but when I start typing the data is not replaced. #331

Closed
drodmaster opened this issue Mar 2, 2015 · 7 comments

Comments

@drodmaster
Copy link

Hi,

I have set up the following in my custom keyboard. No preview pane:

$('#keyboard').keyboard({
usePreview : false,
visible: function(e, keyboard, el) {
keyboard.$preview[0].select();
}
});

The text is selected when I click on the field but when I start to click on the keyboard keys the characters are inserted into the current text instead of overwriting the characters.

This happens in your selectText fiddle: http://jsfiddle.net/Em8sG/3406/

Any ideas how to fix this?

@Mottie
Copy link
Owner

Mottie commented Mar 2, 2015

Hi @drodmaster!

I'm not seeing this behavior in Chrome, what browser are you seeing this issue in?

@Mottie
Copy link
Owner

Mottie commented Mar 2, 2015

Hmm, never mind, I am seeing that happen in Firefox, but only when usePreview is false. I'll investigate.

@drodmaster
Copy link
Author

I'm using IE 10 (Compatibility View with Document mode: Standards) and it fails when usePreview is true also.

@Mottie Mottie closed this as completed in f8ffb93 Mar 2, 2015
@Mottie
Copy link
Owner

Mottie commented Mar 2, 2015

Ok, all fixed in the master branch!

I tried to update the demo and point to the raw master file, but it doesn't seem to be updating 😿


Never mind, it's working now!

@drodmaster
Copy link
Author

@Mottie,

Thanks for the quick fix. I see that it is working in the demo now (in IE).

@Mottie Mottie removed the Next Update label Mar 3, 2015
@ageblade
Copy link

If anyone still comes here, this feature didn't work for my because my input was of type 'number'.
Changed it to 'text' and it's working like a charm.

@Mottie
Copy link
Owner

Mottie commented Nov 12, 2015

@ageblade that is due to browsers adhering to the HTML Standards that establish that only specific input types are allowed to have text selection. See #241 for other problems with caret positioning.

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

3 participants