Skip to content

Easiest way to prevent normal text from being focusable #3550

Answered by jadeddelta
einGlasRotwein asked this question in Q&A
Discussion options

You must be logged in to vote

hi juli,

don't worry, there are no stupid questions, especially for web dev :). i'm not sure about the blinking cursor, it might just be a quirk with your browser or cursor software. but as for preventing focusable text: adding user-select: none; is pretty much the only simple way to do it. i believe there's not really any unintended consequences as it only focuses on text, so buttons and text within input fields are still interactable and selectable by the user, but any regular text cannot be.

also: if your experiment is targeting safari, it's important to note that user-select cannot be used (apple has yet to implement it to work with the base css rule), you'll also have to add -webkit-…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by einGlasRotwein
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants