Don't focus textarea on tapstart for static math #314
Closed
+2
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We only need focus when something is selected, and the fact that we were focusing prematurely resulted in some small behavior inconsistencies between the first and second time e.g. that you'd click on a static table cell in the calculator.
Problem this solves (very subtle, but noticeable if you follow these exact steps)
(1) open www.desmos.com/calculator
(2) type "sqrt(2)"
(3) click on the graph paper to deselect the expression
(4) mousedown somewhere inside of the number, but don't mouse up yet!
--note: the expression immediately selects, before the mouse up.
(5) click back on the graphpaper to deselect the expression
(6) mousedown on the 4 again, and again don't mouse up yet.
--note: now the expression doesn't select yet--
it will select if you either:
(a) move the mouse to start selection --or--
(b) complete the tap, which causes us to call .select() on the mathquill, which again cause focus to enter the textarea and bubble up
I prefer the second behavior -- no focus until we need it.