Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextExpander replacements are not working on Edge on Windows #5569

Open
sibljon opened this issue Nov 28, 2023 · 2 comments
Open

TextExpander replacements are not working on Edge on Windows #5569

sibljon opened this issue Nov 28, 2023 · 2 comments

Comments

@sibljon
Copy link

sibljon commented Nov 28, 2023

Description
I'm a developer at Spruce Health, where we have customers complaining that TextExpander completion is buggy in our web application. We use Slate.js to power our composer text field, and have been able to reproduce the following behavior reported by customers:

TextExpander Snippet Content: google.com/something/healthcare/privacy
TextExpander Snippet Abbreviation: ;mych

What happens is that TextExpander attempts to select the whole abbreviation (say ;mych is the abbreviation), and then deletes it; however, it only selects part of the abbreviation (say, just the colon), which means the abbreviation doesn't get completely removed, and you end up with the replacement + part of the abbreviation (so in this case, google.com/something/healthcare/privacymych – note the trailing mych part at the end should have been replaced).

Please see attached video for a full demo and description.

This can be reproduced fairly easily in Slate.js's demo page:
https://www.slatejs.org/examples/richtext

Recording

Here's a very concise demo of the issue, which I'm recording on the Slate demo app on Edge in Windows:
https://github.com/ianstormtaylor/slate/assets/442307/7bd74607-9f83-40e4-b521-f83ff19b4e98

Here's a more in-depth video that shows how I have my abbreviation configured in TextExpander:
https://github.com/ianstormtaylor/slate/assets/442307/00888f3f-357c-440b-8922-22aa32fd81f6

Sandbox
This is fairly trivial to reproduce here on the demo website (it helps to type quickly, I think):
https://www.slatejs.org/examples/richtext

Steps
To reproduce the behavior:

  1. Set up your TextExpander snippet as I've defined above
  2. Type ;mych quickly into the Slate composer. Perhaps you'll have to type quickly, and try 2-3 times.
  3. Observe the bug: that only part of the text seems to be replaced, where often mych is left (and the semi-colon deleted)

Expectation
I expect the whole abbreviation ;mych to be replaced. This works correctly on Firefox on Windows, and all macOS browsers (that I've tried thus far).

Environment

  • Slate Version: 0.101.1
  • Operating System: Windows 11
  • Browser: Edge (but I've reproduced on all Chromium browsers) – but it's working correctly on Firefox

Context
TextExpander 7.7.1

@sibljon
Copy link
Author

sibljon commented Nov 30, 2023

Update: I wanted to post a link to a Slack thread in the Slate Slack where Joe gave me some tips on debugging this.

@gdehmlow
Copy link

gdehmlow commented Dec 4, 2023

I've also found that TextExpander rich text replacements also just straight up break the editor, happens on slatejs.org. I can't figure out how exactly they're inserting the content but it's uh.. not using the paste handler or triggering onDOMBeforeInput

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants