Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small tweak to focus behavior #317

Merged
merged 3 commits into from
Dec 16, 2024
Merged

Conversation

eluberoff
Copy link
Member

This makes two changes that will be helpful for static maths in the calculator:

(1) adds a "select" method to StaticMath, so that we don't need to rely on initial focus as the only way to select content

(2) fixes a bug where mousedown on a static math would -- just the first time -- fire off a focus event, before anything was selected.

Repro for this (very subtle):
(1) open https://www.desmos.com/scientific
(2) type sqrt(2)
(3) click on the evaluation on the right (note that the expression would deselect)
(4) click back into the left side to re-focus the expression
(5) click on the evaluation on the right again (note the expression doesn't deselect the second time)

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
so that we can use it in StaticMath as well
@eluberoff eluberoff force-pushed the small-tweak-to-focus-behavior branch from d8c787d to 70dae6a Compare December 16, 2024 16:10
Copy link

@jared-hughes jared-hughes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks good, nice tests.

@eluberoff eluberoff merged commit 13a922b into main Dec 16, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants