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

fix(ui5-menu): fix runtime js error on getElementById call #8021

Merged
merged 3 commits into from
Dec 19, 2023

Conversation

ilhan007
Copy link
Member

@ilhan007 ilhan007 commented Dec 18, 2023

The PR adds a check to guarantee getElementById is called only if existing, e.g. the Menu is still part of the DOM tree and has not been removed in-between.
The test pages changes are not related to the change, but we have noticed that the used CSS classes "samples-margin", "header" are missing and they are not doing anything. In addition, h tags have been replaced by ui5-title, so that the texts are readable in HC themes (otherwise you get dark texts on dark background)

Note: Writing test would be tricky as we need to mimic delayed DOM removal where the delay is not known, but it should be fine as the change only makes the code safer.

Fixes: #8017

- adds a check to guarantee getElementById is called only if existing
@ilhan007 ilhan007 merged commit 65a73d7 into main Dec 19, 2023
8 checks passed
@ilhan007 ilhan007 deleted the fix-menu-getElById-ex branch December 19, 2023 13:57
PetyaMarkovaBogdanova pushed a commit that referenced this pull request Jan 17, 2024
The PR adds a check to guarantee getElementById is called only if existing, e.g. the Menu is still part of the DOM tree and has not been removed in-between.
The test pages changes are not related to the change, but we have noticed that the used CSS classes "samples-margin", "header" are missing and they are not doing anything. In addition, h tags have been replaced by ui5-title, so that the texts are readable in HC themes (otherwise you get dark texts on dark background).

Fixes: #8017
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.

[Menu]: rootNode.getElementById is not a function
3 participants