Allow text selection - why by default?


#1

textSelection
This ‘Allow text selection’ is turned on programmatically by default on all new items I add to the document.

What is the point to have this ON
for ALL elements we add to the document,
including pictures and graphics without text?

I assume only a small % of hype doc creators would deliberately activate the text selection feature.
I have to switch it off in all cases, because there is no point to highlight the text on e.g. buttons with editable text.
Beside this, in some cases the cursor’s shape turns into the I-beam when hovering over raster elements with no text ( cursor pointer set to automatic).

It does have an impact on my performance because I cannot switch it off globally but manually for every element.
That said, why not to give users the possibility to switch this off globally in preferences, just a thought for @jonathan ? Or is it just me misunderstanding something and struggling with that?


Interactive timeline for all hospitals in Amsterdam
(Loves Hype) #2

This is a misinterpretation of the abstraction in the interface (GUI). In code it’s in reverse so if you deselect this option Hype disables the text selection by adding something to the output. If left set Hype does nothing to the HTML element. Meaning to fix this the interface would have to read as “Disallow Textselection”. But either way there shouldn’t be any performance overhead.


(Mark Hunte) #3

I actually had to do the reverse for this on a Chrome plugin I wrote.
The site the plugin works with disabled ALL user text selection. So I needed to enable it.

Although I used all in the properties you can also use none

<style>

.HYPE_element {
  -webkit-user-select: none;  /* Chrome all / Safari all */
  -moz-user-select: none;     /* Firefox all */
  -ms-user-select: none;      /* IE 10+ */
  user-select: none;          /* Likely future */  
cursor: default;     /* So the cursor does not change to a text selection cursor */
   
}

</style>

Assuming .HYPE_element will catch everything…


(Jonathan Deutsch) #4

Selectable text is the default for text on the web.

Be sure to have good reason to uncheck this; not having selectable text can interfere with a lot of common use cases such as sharing content, translating content if you do not speak the language fluently, using text-to-speech, scroll-selecting, etc.

Hype by default does not allow text selection for Buttons because that is one of the reasonable cases where there will be other click actions. Otherwise we don’t make assumptions that go against the grain of the web.

This should be fine, but standard disclaimer that it uses Hype internals and is technically unsupported.


#5

Yes @jonathan
I understand your reasoning for text-to-speech etc. readable text cases,
but honestly I don’t get the logic behind allowing
text selection cursor
over elements like images, videos, other rasterized graphics containg no selectable text at all?


(Jonathan Deutsch) #6

I’m not sure I follow - web browsers dynamically choose which cursor to show based on the content; they don’t typically show a text cursor over images/video.

I can understand that from a Hype editor UI standpoint it perhaps doesn’t make sense to enable the “Allow text selection” checkbox for some types elements, but it really just is a clean mapping of adding user-select: none to the element when unchecked.


#7

HI @jonathan
Other users would also prefer to have the possibility to switch off ‘Allow text selection’ globally in preferences


(Mark Hunte) #8

But I suspect most are not bothered.
And a near global way is to select all the elements together and use the uncheck . :wink:


#9

yes, that way I did it !
a little bit of :monkey: business