Open thomaslic opened 1 year ago
@thomaslic
When setting elementGuidelines, I made sure to exclude only targets.
const flattenSelectedLayers = layerManager.toFlatten(selectedLayers);
const elementGuidelines: Array<ElementGuidelineValueOption | MoveableRefType<Element>> = [
".scena-viewport",
...layers.filter(layer => !flattenSelectedLayers.includes(layer)).map(layer => layer.ref),
];
Environments
Description
Hello
I am using Selecto in combination with Moveable and I wondered if there is a way to only show Element Guidelines of other Moveables and not the "selected" moveable?
Example: when you look at the use case below, I dragged the selected element from position "1" to position "2" and I don't want to see the Element Guidelines to position "1" since there is no element on that position anymore.![image](https://user-images.githubusercontent.com/74171388/205485398-61b8e1f9-2ea7-41ed-aee0-924d41cf4420.png)
I got it to work when using Moveable alone by removing the dragged Moveable Target HTML-element from the Moveables elementGuideline array. In combination with Selecto, this approach does not seem to work, since the Target of a Moveable can be "undefined".
I also tried it in the example you provided in the Storybook, but i didnt manage to do it.![image](https://user-images.githubusercontent.com/74171388/205485048-85d14333-a030-4b43-8518-845788f78a70.png)
I wondered if you could take a look into that and maybe provide a simple example for it. Thanks for your help!