selecto icon indicating copy to clipboard operation
selecto copied to clipboard

feature request: selection box CSS customization.

Open aliveornot opened this issue 1 year ago • 6 comments

Environments

  • Framework name: react. (but the requested feature is framework-agnostic)
  • Framework version:
  • Component name: selecto
  • Component version:
  • Testable Address(optional):

Description

Before start, kudos to your impressive work! It helps me a lot!

It would be great if the css styling of .selecto-selection div (i.e. the skyblue rectangle displayed when I drag, to indicate the selected region) can be customized. image

The motivation:

  1. I have two different types of selection mode in my app. It would be great if I can display it intuitively.
  2. Plus, I think selecto can potentially be used to DRAW a
    in real time, in which case, transparent background rectangle is more appropriate than the sky blue one.

Thanks a lot!

aliveornot avatar Aug 11 '22 02:08 aliveornot

@aliveornot

For now, I have no choice but to tell you to process it with css.

There is a way to force assignment using !important.

.selecto-selection {
    position: fixed;
    display: none;
    border: 1px solid #4af;
    background: rgba(68, 170, 255, 0.5);
    pointer-events: none;
    will-change: transform;
    z-index: 100;
}

daybrush avatar Aug 11 '22 07:08 daybrush

Thank you very much! Actually I had somewhat similar workaround in my mind, but this seems better. I'll try.

aliveornot avatar Aug 11 '22 08:08 aliveornot

@daybrush Hi, thanks a lot in advance, is there any way to disable selecting targets with selection box?

golnaaz73 avatar Feb 25 '23 16:02 golnaaz73

@golnaaz73

okay. I'll consider it.

daybrush avatar Mar 02 '23 12:03 daybrush

@golnaaz73

okay. I'll consider it.

I set clickBySelectEnd prop true and it solved the problem, thanks

golnaaz73 avatar Mar 02 '23 12:03 golnaaz73

am also looking for this. can you add a field for pass a css ?

		const selecto = new Selecto({
		
		// pass a custom classname
		className:'myClassName',
		
		
			// The container to add a selection element
			container: document.body,

			// Selecto's root container (No transformed container. (default: null)
			rootContainer: null,

			// The area to drag selection element (default: container)
			dragContainer:document.body,

			// Targets to select. You can register a queryselector or an Element.
			selectableTargets: ['.KeyPoint'],

			// Whether to select by click (default: true)
			selectByClick: true,

			// Whether to select from the target inside (default: true)
			selectFromInside: true,

			// After the select, whether to select the next target with the selected target (deselected if the target is selected again).
			continueSelect: false,

			// Determines which key to continue selecting the next target via keydown and keyup.
			toggleContinueSelect: 'shift',

			// The container for keydown and keyup events
			keyContainer: window,

			// The rate at which the target overlaps the drag area to be selected. (default: 100)
			hitRate: 100,

		});

jonlepage avatar Mar 25 '23 03:03 jonlepage