You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only the left side was lowercased, so a term stored as Issue produced "issue" === "Issue". This resulted in no match, empty result, no popup. Terms stored lowercase were unaffected, which is why the failure only showed on capitalized entries.
Fix
Lowercase both sides of the comparison.
Testing
Created two local terms, one stored capitalized and one lowercase, each with a definition and an Arabic translation. Before the change, only the lowercase term opened its popup; after, both do.
Thanks! Fixed formatting with npm run prettier.
btw, and unrelated to this fix, I noticed that Hightlight.tsx:115 applies term regex using [a-zA-z]* rather than [a-zA-Z]*, which includes non-alphabetical characters. Was this intentional? Thanks!
btw, and unrelated to this fix, I noticed that Hightlight.tsx:115 applies term regex using [a-zA-z]* rather than [a-zA-Z]*, which includes non-alphabetical characters. Was this intentional? Thanks!
I'll check with @eemeli, but feels like a typo (from #3014)
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
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.
Fixes #4474
Problem
Clicking a term in the source string did nothing when the term was stored with an uppercase first letter in the terminology database.
Cause
Highlight.tsxwrites the term's stored text intodata-matchon the<mark>element. The click handler inOriginalString.tsxthen looked it up with:Only the left side was lowercased, so a term stored as
Issueproduced"issue" === "Issue". This resulted in no match, empty result, no popup. Terms stored lowercase were unaffected, which is why the failure only showed on capitalized entries.Fix
Lowercase both sides of the comparison.
Testing
Created two local terms, one stored capitalized and one lowercase, each with a definition and an Arabic translation. Before the change, only the lowercase term opened its popup; after, both do.
Visual proof:
PR1.Pontoon.webm