-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Lens] Fix switching with layers #71982
[Lens] Fix switching with layers #71982
Conversation
@@ -222,7 +222,7 @@ export function InnerWorkspacePanel({ | |||
/> | |||
</EuiLink> | |||
</small> | |||
</p> | |||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😕 ? What does this fix? Using paragraphs is better DOM rendering for screen readers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It fixes this warning:
console.error
Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>.
in div (created by EuiIcon)
in EuiIcon (created by Context.Consumer)
in EuiI18n (created by EuiLink)
in a (created by EuiLink)
in EuiLink (created by InnerWorkspacePanel)
in small (created by InnerWorkspacePanel)
in p (created by InnerWorkspacePanel)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those all stem from EuiIcon
and it'll be hard to get rid of them until we change the element that EuiIcon
renders. I'd rather keep the appropriate text elements for screen-readers when possible and I'll make an issue for this in EUI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok this is weird, EuiIcon does not in fact ever render a <div>
(I think it did way back when, but now it's just a simple <svg>
). So this error message is actually completely false. Do we know who setup this DOM validator so I can follow up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so I think I've tracked this down to the fact that in Kibana, because EuiIcon is dynamically imported, jest tests mock the component into rendering a <div>
. So the React warning is actually remarking on the snapshots and not the actual dom. I'll see if the mocks are also coming from EUI, and if so, just get them to render a span
.
But in the meantime, can you revert this p
to div
change? If you truly like the minimized space between the two lines, then wrap them all in a single <p>
with a <br />
in between.
Pinging @elastic/kibana-app (Team:KibanaApp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you for fixing this. I tried out a couple scenarios and switching between the different x/y charts no matter how many layers seems to work fine.
@@ -222,7 +222,7 @@ export function InnerWorkspacePanel({ | |||
/> | |||
</EuiLink> | |||
</small> | |||
</p> | |||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😕 ? What does this fix? Using paragraphs is better DOM rendering for screen readers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested in Firefox and works as expected, LGTM 👍
💚 Build SucceededBuild metricspage load bundle size
History
To update your PR or re-run it, just comment with: |
* [Lens] Fix chart switching with multiple layers * Unskip Lens smokescreen test * Fix types * Revert <p> change
* [Lens] Fix chart switching with multiple layers * Unskip Lens smokescreen test * Fix types * Revert <p> change
* master: [Observability] Remove app logos (elastic#72259) Fix float percentiles line chart (elastic#71902) update chromedriver to 84 (elastic#72228) [esArchiver] actually re-delete the .kibana index if we lose recreate race (elastic#72354) [Maps] convert SavedGisMap to TS (elastic#72286) [DOCS] Removes occurrences of X-Pack Security and Reporting (elastic#72302) use WORKSPACE env var for stack_functional_integration tests, fix navigate path (elastic#71908) [Monitoring] Fix issue with ES node detail status (elastic#72298) [SIEM] Updates consumer in export_rule archive (elastic#72324) [kbn/dev-utils] add RunWithCommands utility (elastic#72311) [Security Solution][Endpoint][Exceptions] Only write manifest to policy when there are changes (elastic#72000) skip flaky suite (elastic#72339) [ML] Fix annotations pagination & change labels from letters to numbers (elastic#72204) [Lens] Fix switching with layers (elastic#71982) [Maps] 7.9 documenation updates (elastic#71893) docs: ✏️ add "Explore underlying data" user docs (elastic#70807) [Security Solution][Exceptions] - Remove initial add exception item button in builder (elastic#72215) Fix indentation level in code exploration doc (elastic#72274) register graph usage (elastic#72041) [Monitoring] Added a case for Alerting if security/ssl is disabled (elastic#71846)
There were two issues with the chart switcher that caused it to remove all layers when using these steps:
There were two areas in the code that needed to be fixed:
The new code also includes a functional test and unit test for the chart switching behavior with multiple layers.
Passes 42 times in flaky test runner: https://kibana-ci.elastic.co/job/kibana+flaky-test-suite-runner/593/
Fixes #71372