selecto icon indicating copy to clipboard operation
selecto copied to clipboard

selecto-selection element appears as opaque blue

Open benwoodward opened this issue 2 years ago • 1 comments

Environments

  • Framework name: selecto-svelte
  • Framework version: 1.15.0
  • Component name: Selecto
  • SvelteKit version: 1.0.0-next.295

Description

I have two Selecto instances on the page, the one in the timeline works fine:

Screen Shot 2022-03-24 at 2 20 10 PM

However, the one that I'm trying to get to work with the text always appears with 100% opacity:

image

  <Selecto
    dragContainer={'#transcript-paragraph'}
    selectableTargets={['#transcript-word']}
    hitRate={100}
    selectByClick={false}
    selectFromInside={true}
    ratio={0}
    on:selectEnd={handleSelectEnd}
    bind:this={selecto}
    />

(It does appear to select properly)

If I reveal the selecto-selection element while it's not in use:

image image

Then it has the correct appearance!

image

I've pored through all of the CSS that applies to this element on the ones above, tried disabling other CSS styles and CSS vars and cannot figure it out.

EDIT: So I refreshed the page, and now I'm noticing that this time it seems less than opaque:

image

If I manually change the opacity of the element's background to 0.1 instead of 0.5 then I get the right opacity:

image

Screen Shot 2022-03-24 at 2 34 25 PM

Very strange. ~~Seems like this is potentially a Chromium bug?~~ Problem confirmed to exist in Safari and Firefox

EDIT: Workaround:

:global(#transcript-paragraph .selecto-selection) {
  background: rgba(68, 170, 255, 0.1) !important; /* some weird opacity bug */
}

benwoodward avatar Mar 24 '22 03:03 benwoodward

@benwoodward

It is a very difficult unknown problem. Since it is not reproduced, I think I need to check the demo address, OS, and Chrome version that I can test.

daybrush avatar Apr 01 '22 12:04 daybrush