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

Add group/data fields to onWillShowOverlay's event #564

Closed
artaommahe opened this issue Apr 11, 2024 · 1 comment · Fixed by #566
Closed

Add group/data fields to onWillShowOverlay's event #564

artaommahe opened this issue Apr 11, 2024 · 1 comment · Fixed by #566

Comments

@artaommahe
Copy link

Is your feature request related to a problem? Please describe.

An event in onWillShowOverlay hook has very little information about what's going on. There are no data about tab/group that is dropping and tab/group we dropping to.

We have a pretty specific case - we need a group with several tabs (1-2) to be locked but having group's header visible (to switch between tabs and to show additional action in the tabs container). Current group.lock implementation still allows to move tabs inside locked group by dragging them over the header so we had to use onWillDrop hook to manually implement required logic. The only thing that remains and that we can't properly fix hacking around dropview's api - prevent drop zones to be shown over locked group's header and in the middle of the group (we still allow to drop to the side of the locked group so we need those drop zones). We wanted to use onWillShowOverlay for this, but event object there contains no information of what is dragged and where we want to drop to.

The described case is implemented here so you can clearly see the problem and partial solution

https://codesandbox.io/p/sandbox/dockview-prevent-dropzones-355pzd?file=%2Fsrc%2Fapp.tsx%3A23%2C32

Describe the solution you'd like

event object in onWillShowOverlay hook also provides group and getData fields/methods

Describe alternatives you've considered

Don't see any alternative for this with the current api. Having proper locked groups that doesn't allow to drop stuff via header would be better but that's an another story.

Additional context

~

@mathuo mathuo linked a pull request Apr 14, 2024 that will close this issue
@mathuo mathuo reopened this Apr 14, 2024
@mathuo
Copy link
Owner

mathuo commented Apr 15, 2024

Released version 1.12.0 with the additional properties added to the onWillShowOverlay events and have noted the improved group options in general in another issues here

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 a pull request may close this issue.

2 participants