-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[Bug]: commands.focus() triggers blur #5992
Comments
I wasn't able to reproduce it myself, no I tried adding a button that will run the blur command too and same here - I only received the |
I made a video for you. It shows that In our app, the issue is exactly the same as in this demo. When we programmatically focus on the editor, the |
@elledienne This is affecting my project as well. I've submitted a PR that restores the original code and implements a fix for the Android issue without more broadly affecting non-Android and non-iOS users. |
Probably should not be using editor.commands.focus like that in an effect (not to detract from the regression in behviour) There is an |
@nperez0111 Assuming the |
Yea, I mean it is not satisfying, but I'll take it |
Released in version 2.11.3 |
But, again, you are using the focus command wrong, and should reconsider |
I'm facing the same issue on web; when I trigger |
@bianca-artola-dialpad, how you are using it, sounds correct to me. You are right, What version & platform are you on? Because version 2.11.3 should be how it was working prior. Also, curious what event handlers you guys are even registering for |
Tiptop version:
I can try updating to 2.11.3.
We use the blur event to track when the input loses focus so we can display or hide UI elements based on the input's focus state. For example:
This allows us to dynamically toggle the visibility of components like the footer. |
Updating @tiptap/core to "^2.11.3" did not fix the issue. Was the fix that was made also for web? or it was only for mobile? |
Can you double check upgrading all of your packages (aka all If that does not work, then you likely will need to create a new issue with a reproduction, because it likely is not the same issue as this one then |
Affected Packages
core
Version(s)
2.11.0
Bug Description
After upgrading to 2.11.0, calling
editor.commands.focus()
triggers a focus and blur event in short successionBrowser Used
Chrome
Code Example URL
https://codesandbox.io/p/sandbox/friendly-paper-wzyqyg
Expected Behavior
Blur should not fire
Additional Context (Optional)
I'm positive this issue is caused by this PR which changes how focus is triggered - in fact, commenting out that line of code fixes the issue for me
Dependency Updates
The text was updated successfully, but these errors were encountered: