daybrush / selecto

Selecto.js is a component that allows you to select elements in the drag area using the mouse or touch.
https://daybrush.com/selecto
MIT License
2.04k stars 82 forks source link

Hide control box for specific targets #118

Closed adela-almasan closed 1 year ago

adela-almasan commented 1 year ago

Environments

Description

Hey @daybrush! I'm trying to find a way to hide the moveable control box for certain elements (and apply my own styling), while still keeping the ability to select them. I'm not sure if this can be achieved with the current implementation and would appreciate your input.

I think a suggestion would be to have selectableTargets as an array of objects with a property for that and hide/display according to that property. That would possibly allow even more custom functionality.

Thank you!

daybrush commented 1 year ago

@adela-almasan

How about setting selectableTargets to filter?

selectableTargets={selectableTargets.filter(target => target.display)}
adela-almasan commented 1 year ago

Closing this one in favor of https://github.com/daybrush/moveable/issues/848. Ty!