Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Text selection color when input is clicked in Chrome #36

Open
Sanabria opened this issue May 30, 2014 · 0 comments
Open

Text selection color when input is clicked in Chrome #36

Sanabria opened this issue May 30, 2014 · 0 comments

Comments

@Sanabria
Copy link

This has been a simple yet tricky issue for me to resolve.

Once you click the input and the current page number becomes editable, the browser's default text selection color kicks in highlighting the number with that known faint blue. Normally, it shouldn't be a problem but when the input is stylized with a dark background the contrast is not a good and the number is barely visible.

I have tried changing the background color for the text selection using the ::selection selector (according to http://css-tricks.com/overriding-the-default-text-selection-color-with-css/) and it does work in Firefox. However, Chrome refuses to change it. I realize this is a browser issue and that not much can be done about it.

Here's a jsfiddle to better explain myself: http://jsfiddle.net/sanabria/Q749M/4/

I was wondering if the automatic text selection when the input is clicked can be prevented so I can avoid the issue altogether. Thanks in advance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant