4 ms·
This is pretty cool, with this app (and a lot of other HTML5 apps) I often have an issue where it acts as if I'm trying to select text as if I was going to copy
by kreek 15y ago
This is pretty cool, with this app (and a lot of other HTML5 apps) I often have an issue where it acts as if I'm trying to select text as if I was going to copy and paste. The result is the entire app gets the 'text-selected' blue overlay. Anyone know of way to prevent this? I'm not sure that e.preventDefaut() stops it.
- mofle 15y agoYou can use CSS user-select:none; on the elements you want to prevent selection on.
- jarek-foksa 15y agoWhen building desktop-like apps I'm using following snippet to disable text selection everywhere: body * { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } Then I whitelist any elements that should be selectable: textarea, input, [contenteditable="true"] { -webkit-user-select: text; -moz-user-select: text; -ms-user-select: text; user-select: text; }