easy-email-editor icon indicating copy to clipboard operation
easy-email-editor copied to clipboard

Mozilla Firefox text select problem

Open seyitgokce opened this issue 3 years ago • 4 comments

Hi,

When i added a text block or i want edit a text block, i cant select text with mouse click at Firefox browser. Not any problem at Chrome / IE browser.

Thanks

seyitgokce avatar Jul 25 '22 13:07 seyitgokce

https://github.com/arco-design/easy-email/issues/82

We used shadow dom to isolate styles, but the selection API is not widely supported. Maybe we will migrate shadow dom to iframe. Related: https://github.com/WICG/webcomponents/issues/79#issuecomment-988103206

m-Ryan avatar Jul 26 '22 09:07 m-Ryan

When I open FF with debug console there is unsupported function for ShadowRoot API: getSelection. See https://caniuse.com/mdn-api_shadowroot_getselection . Can you fix it please at this line? const range = (getShadowRoot() as any).getSelection().getRangeAt(0);

Is it possible use this polyfill? https://github.com/GoogleChromeLabs/shadow-selection-polyfill

applibs avatar May 30 '23 12:05 applibs

When I open FF with debug console there is unsupported function for ShadowRoot API: getSelection. See https://caniuse.com/mdn-api_shadowroot_getselection . Can you fix it please at this line? const range = (getShadowRoot() as any).getSelection().getRangeAt(0);

Is it possible use this polyfill? https://github.com/GoogleChromeLabs/shadow-selection-polyfill

Hi @applibs!

I've had the same issue and I found that you can use this polyfill as a workaround. It's not complete, but it does solve the problem for Firefox and Safari.

Here's the link to the original discussion: https://github.com/GoogleChromeLabs/shadow-selection-polyfill/issues/11

Hope this helps :)

a-sokolova-dev avatar Jun 06 '23 15:06 a-sokolova-dev

I am not participiant and I dont want be. Please fix it for others too. Thx.

Otherwise, Mozila has a whole other set of problems and it's basically unusable in FF.

  1. Double-click selection when text is formatted
  2. normal selection when text is formatted
  3. Select placeholder

Please change this line: backgroundColor: 'var(--color-bg-5);', with: backgroundColor: 'var(--color-bg-5)',

FF does not like semicolon there.

applibs avatar Jun 07 '23 09:06 applibs