Skip to content

Commit

Permalink
Fix mobile cursor from jumping to bottom
Browse files Browse the repository at this point in the history
When selecting text on the android, it was possible to also highlight the text inside the buttons in the adder. When this happened, the range would grab everything from where you started to highlight to the very end of the dom because the adder is attached as the last node inside body.

The simple fix is to prohibit text selection inside the adder which prevents the selection from getting the adder itself.
  • Loading branch information
Kyle Keating authored and robertknight committed Oct 12, 2020
1 parent 150e15b commit 3111f65
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/styles/annotator/components/adder.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ $adder-transition-duration: 80ms;
background: var.$color-background;
border-radius: var.$annotator-border-radius;

// Prevent the browser from selecting text in the adder itself during text
// selection.
//
// See https://github.com/hypothesis/product-backlog/issues/878
user-select: none;

// The adder toolbar has a distinctive, broad-spreading drop shadow
box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.25);

Expand Down

0 comments on commit 3111f65

Please sign in to comment.