Libelektra: Elektra-web selecting text is not possible on firefox

Created on 21 Mar 2018  路  9Comments  路  Source: ElektraInitiative/libelektra

Unfortunately, I really cannot find a way to solve this in Firefox.

In webkit based browsers, I can do onDragStart={e => e.preventDefault()} on a part of the element (in this case, only the text field) and it prevents dragging the element while still allowing text selection.

In Firefox, however, it seems to also prevent text selection, so there is no way to prevent dragging while still allowing text selection.

bug

Most helpful comment

@markus2330 @Namoshek I tried disabling drag & drop when alt is pressed. However, this requires a re-render of the whole tree view (not just single components of it), because all elements need to be set to not be draggable anymore. Unfortunately, this is a quite expensive operation which would get executed every time the alt key is pressed (and again when it is released!) :/

My workaround here is that I added a button to copy the current value of a key. Using keyboard shortcuts to select and cut text also works. Selecting also works fine for me on latest Chrome:

selecting

All 9 comments

Is it important to prevent dragging?

@markus2330 if we don't prevent dragging, the whole key gets dragged instead of selecting text.

I want to be able to drag the whole key except when dragging in the text field, which is exactly what this solution does on webkit browsers, but not on firefox 馃槩

Sorry, I cannot help.

Maybe @Namoshek or @vanessaNWK know something about it.

Otherwise asking the question somewhere else might help.

Did you have luck by asking the question somewhere else?

What about a button to mark the value as workaround?

Marking the keys works, although a new-line is added to the copy-buffer.

Sorry, I forgot about this issue. Maybe disabling all default event handlers while a specific key (ctrl or alt) is pressed might work?

@markus2330 @Namoshek I tried disabling drag & drop when alt is pressed. However, this requires a re-render of the whole tree view (not just single components of it), because all elements need to be set to not be draggable anymore. Unfortunately, this is a quite expensive operation which would get executed every time the alt key is pressed (and again when it is released!) :/

My workaround here is that I added a button to copy the current value of a key. Using keyboard shortcuts to select and cut text also works. Selecting also works fine for me on latest Chrome:

selecting

:tada: Great!

Please also test it with Firefox ESR

@markus2330 I will test all features on firefox ESR before creating the next PR :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PhilippGackstatter picture PhilippGackstatter  路  45Comments

sanssecours picture sanssecours  路  28Comments

markus2330 picture markus2330  路  38Comments

markus2330 picture markus2330  路  35Comments

ghost picture ghost  路  29Comments