Repository navigation
Conversation
Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
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.
Description
Legend and tooltip drawing call
overrideTextDirection, which saves the canvas's original CSS direction and priority on the context. Their restore calls currently pass the configured direction string, butrestoreTextDirectiontreats that value as a[direction, priority]tuple. It consequently attempts to restore individual characters of "rtl" or "ltr", leaving the override on the canvas.For example, an RTL legend on an LTR canvas causes a tooltip with no textDirection override to render "Hello, World!" as "!Hello, World". Drawing also leaves the canvas's inline direction changed, including its priority.
Default the helper's optional restoration tuple to the saved context value, and have both plugins call it without the direction string. Explicit tuple callers remain supported. No layout or configured text-direction behavior is changed.
The earlier report #7035 identified the call-signature mismatch. The #7030 change removed the helper's saved-context read; this restores that fallback while preserving the subsequently typed optional tuple parameter.
Tests
27 native Chrome cases cover legend and tooltip drawing with both directions, original CSS direction/priority, empty inline styles, explicit tuple compatibility, no saved override, and cross-plugin isolation. 21 fail on unchanged master; six are controls.
Fresh frozen-lockfile dependency install, full ChromeHeadless suite: 1730 passed. Rollup build, declaration emit and TypeScript noEmit passed. Changed-file ESLint has zero errors and five unchanged warnings (one unused parameter and four tooltip max-statements warnings). Firefox and downstream tests were not run. Local Chrome launcher settings are not included.