grafana
grafana copied to clipboard
Drawer: allow overriding default zIndex, focus props
What is this feature? Fixes bugs when embedding scene plugins within a Drawer component. The default z-index of the RcDrawer is 1040, but scenes uses a z-index of 1030 for dropdown components, so Scenes variables are unusable when used in a Drawer.
Also the FocusScope component will automatically set focus on MultiSelect components when the user clicks off of the input, which re-opens the input, making it impossible for users to close the input when used within a Drawer.
Why do we need this feature? So plugin components embedded within a Drawer can use scene variables and MultiSelect.
Who is this feature for? Plugin developers attempting to expose their plugin to other plugins that embed plugins in a Grafana Drawer component.
Special notes for your reviewer: Without control over these props we are forced to copy/paste the current Drawer component into an app plugin.
Please check that:
- [x] It works as expected from a user's perspective.
- [ ] If this is a pre-GA feature, it is behind a feature toggle.
- [ ] The docs are updated, and if this is a notable improvement, it's added to our What's New doc.
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 2 weeks if no further activity occurs. Please feel free to give a status update or ping for review. Thank you for your contributions!
@ashharrison90 @joshhunt Reproduction repo is here: https://github.com/gtk-grafana/grafana-drawerscenesrepro-app
Just clone, install, build, and run the docker, and hit the hello-world slug:
http://localhost:3003/a/grafana-drawerscenesrepro-app/hello-world.
Instructions in the readme are generic defaults, but otherwise work fine.
The exact same component is rendered within and without the Drawer.
https://github.com/user-attachments/assets/3cb6a3ed-3d93-4c79-aff9-5a74e7e59d3c
Not planned, we'll be fixing this via: https://github.com/grafana/scenes/pull/1166