Repository navigation
fix: keep a chart's ring off when Escape's landing passes focus through it - #7516
Merged
Merged
Conversation
Escape from a comment's card lets go of it, and Leaf lands Tab's start beside the reading by focusing the reading block and blurring it in the same script (dom/focus.js, landAtReading). When that block is a chart, its focus listener put the reader on a point, showing the ring and its aim, and the blur took them off again: two writes of display that changed nothing, which the write watch fails. The chart now reads focus once the script that moved it is done, so focus that passes through puts the reader on nothing; a Tab or a click still lands them on a point before the next key. The new browser test fails on both engines before the change with the unchanged writes on g.lf-chart-at and circle.lf-chart-aim. Closes #7513
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When Escape lets go of a comment's card, Leaf moves Tab's starting point beside the reading by focusing the block on screen and blurring it in the same script (
landAtReading). Focus and blur are the only way the platform moves that starting point. When the block is a chart, itsfocuslistener put the reader on a point, showingg.lf-chart-atandcircle.lf-chart-aim, and itsblurlistener hid them again. That made twodisplaywrites that changed nothing, which the write watch fails at teardown.The chart now waits until the script that moved focus has finished before it reads focus (
queueMicrotask). Focus that only passes through puts the reader on no point, and nothing is written. A Tab or click onto the chart still puts the reader on a point within the same task, before the next key arrives. The fix stays inside the chart package: Leaf's landing and the package interface are untouched.test_escape_from_a_point_s_card_leaves_the_chart_s_ring_offfollows the steps in the issue: arrow to a line point, comment withc, send, then press Escape. On main it fails in Chromium and Firefox with the two unchanged writes, and with the change it passes in both. The 51 other chart tests that match focus, key, ring, step and walk also pass.test_a_comment_takes_the_point_a_chart_s_ring_is_onfails on main with and without this change (#7495). #7512 repairs it, and with this fix that test could go back to the line's comment first.Closes #7513 — automated triage