-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dashboard] [Collapsable Panels] Interact with real panel element (#1…
…96756) Closes #190647 ## Summary This PR swaps the interaction of `kbn-grid-layout` so that you are now dragging/resizing the **actual element** rather than the preview - i.e. the preview now shows the **real** / grid aligned location (i.e. where the panel will land once the interaction stops), while the element shows the non-grid-aligned location. **Dragging** | Before | After | |--------|--------| | ![Oct-18-2024 09-10-52](https://github.com/user-attachments/assets/f117124d-3200-4c7b-a5f7-6a4bc767ebff) | ![Oct-18-2024 09-07-25](https://github.com/user-attachments/assets/483d481a-a752-4455-b9bd-2d89ec273454) | **Resizing** | Before | After | |--------|--------| | ![Oct-18-2024 09-11-21](https://github.com/user-attachments/assets/64e4314d-b641-4b0c-a4a9-93e3f0d21cbc) | ![Oct-18-2024 09-07-55](https://github.com/user-attachments/assets/755be726-38bc-475b-a85d-7696262c4b4f) | This serves as more than just a visual update - because we are dragging the real element, the mouse stays "locked" to the drag and/or resize handler, which means we have introduced the possibility for an `onDrop` event. This is necessary in order to keep the current "unsaved changes" behaviour on Dashboard, where changes are triggered only once the panel is actually **dropped** and not when other panels move as a consequence of a drag event. To make this possible, I also removed the `GridOverlay` component - it was creating a transparent `div` **over the entire grid** on interaction, which meant that focus was lost as soon as the interaction started. If we want to restore the "scroll up" and "scroll down" buttons (which we were unsure about, anyway), we would need to rethink this (i.e. just render two fixed-position buttons without any overlay). ### Checklist - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels) - [ ] This will appear in the **Release Notes** and follow the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- Loading branch information
Showing
8 changed files
with
239 additions
and
257 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.