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

fix: Fixes text selection in contenteditable #99

Merged
merged 3 commits into from
Mar 27, 2021

Conversation

jamesthomsondev
Copy link

@simonwep Hello, me again. A slightly different PR, but still regarding some blocking issues related to contenteditable elements.

evt.preventDefault() blocks any sort of text selection within a contenteditable element. Seeing as this appears to be done to stop pull to refresh (which I was not able to confirm as I can still pull to refresh on iOS Chrome 87), it makes sense to only preventDefault in this circumstance (or remove it entirely if it actually has no positive effect).

@simonwep simonwep force-pushed the fix/event-blocking branch from 92caee7 to 2df8145 Compare March 19, 2021 14:25
@simonwep
Copy link
Owner

Okay, just edited your commit message - I'm not using conventional commits here so let us stick to the current "convention" :D
I also moved it to the utils folder as you suggested and I think this is a safe fix - although I'm not sure if this is what user of this library expect:

ugnX7xbshq

But I guess using the event hooks this can be temporarily "disabled" manually by applying user-select: none before selection and removing it afterwards, I like that.

@jamesthomsondev
Copy link
Author

@simonwep Looks good! 👍 I agree, using the event hooks seems ideal for disabling that behaviour if it's undesired. Maybe something to add to your cookbook (Examples.md)

@simonwep simonwep merged commit 404a00d into simonwep:master Mar 27, 2021
@jamesthomsondev
Copy link
Author

@simonwep I think you need to bump the package version. If you run npm install it fetches 2.0.2, which is not the latest release.

@simonwep
Copy link
Owner

simonwep commented Apr 2, 2021

@getreworked Sorry, I didn't publish a new version so far. I hoped I could put more into the next release :/
I just released 2.0.3, I didn't consider it as a "feature" but more of an improvement ^^

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

Successfully merging this pull request may close these issues.

3 participants