#Component inside slot permission drag is not working as expected
1 messages · Page 1 of 1 (latest)
My use case:
I want to have a lock button in the action bar
When the user click on it, it will do this things
- Lock the drag of the current selected component. I just use drag false.
- If the current component have slots inside, it will also lock the drag on each of the component inside the slot. I use walkTree for this, and add lock true (hence drag false in the resolvePermission) for each element inside the slot
- No component should be able to be dragged inside the slot (I use allow "[]") for this.
I need this behavior so that user dont accidently drag item inside or drop item in the locked container.
But the problem is with the drag false inside the slot. I can still drag the item inside the slot,
Hey @lapis holly! Sorry for the delay.
I can replicate this, it only happens inside slots. I'll open an issue for it
This is a bug, it shouldn't be happening
Hey no probbb, I didn't bring any code to replicate also, my bad 😅
Hey @sharp elk , I want to ask, If I were to set permission delete to false, the "native" puck delete action bar will be hidden right,,
But, what if I implement my own action bar,
is there a way to get the permission for the current selected component?
I see chris talk about filtering right here
https://github.com/puckeditor/puck/issues/1172
But, that's only for native puck action bar (duplicate & delete)
What if I have component like in my image, where I implement my own delete button, and my own duplicate btn inside popover,
I think having permission as props would be beneficial 🤔 Just to support puck native permission for my custom implementation?
This also applies in Field, if I have a custom field, I can't simply use "edit" permission true/false, because it only works for native component
Correct me if I'm wrong, or if there's a solution for this 😙