-
Notifications
You must be signed in to change notification settings - Fork 167
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
After inserting a link, A Enter key stop working. As soon link removed from the UI. Enter key working again #2936
Comments
I just tried but I can't repro. Are you able to repro in the demo site https://microsoft.github.io/roosterjs/index.html? |
@JiuqingSong Thank you for getting back to me. It's not on the demo site. I am building an SPFx (SharePoint Framework) web part based on React typescript. All other methods and functions, such as bold, italic, underline, etc., are working as expected. see how I am initializing the editor and see if any advice or pointer or I am missing something Getting the Editor Core method as this is protect
Using the following versions.
|
|
Sorry we can't identify the issue without a local repro. If you have an environment that we can test, or a minimum repro, please share it so we can debug. |
I did more digging into this issue. With the vanilla React app, it's working as expected. The problem seems to be happening in the SPFx web part only. I have created SPFx webpart project for testing. see below URL Repo URL
Component
Node version
Thanks in advance |
how to run this test? |
|
I suggest to build an easier local repro instead of taking too much dependency. Roosterjs is a pure client side library, so in theory it should work with just some html and .js files locally, server side is not needed at all. And from your test, since the issue does not repro on a simple demo, the issue should be caused by some conflict thing from your code or dependencies. I suggest to go through all the event handlers instead editor especially for keydown and keypress event, try remove them one by one, see if it can finally work. And the last removed one should be the root cause. |
Hi @JiuqingSong Thank you for the directions. I was able to fix the issue by handling the keydown and keypress event via custom plugin. Thank you |
Describe the bug
Entering a link in the editor causes the Enter key to stop functioning. The Enter key works normally until a link is inserted using the insertLink function. After inserting a link, pressing Enter has no effect. Removing the link restores normal Enter key functionality.
This issue prevents the creation of new lines and other standard Enter key behaviors within the editor. Any assistance in resolving this would be greatly appreciated.
To Reproduce
Steps to reproduce the behavior:
4.0 Press Enter key. (Observe that a new line is not created).
5.0 Delete the link by deleting the "Google" linked text.
6.0 Press Enter key. (Observe that a new line is created, and the Enter key functions as expected).
Expected behavior
Pressing Enter within the editor should create a new line, regardless of whether a link is present.
Screenshots
![Image](https://private-user-images.githubusercontent.com/19267065/409941853-c8340929-8e51-46e3-8a6c-aaa306e2a388.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNTg0MDUsIm5iZiI6MTczOTM1ODEwNSwicGF0aCI6Ii8xOTI2NzA2NS80MDk5NDE4NTMtYzgzNDA5MjktOGU1MS00NmUzLThhNmMtYWFhMzA2ZTJhMzg4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDExMDE0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM4Y2FhOTUzYzY4ZmVlY2MzZjcxNTJiNGQ5YWM1NGVmODVjM2FiMjhkMDljNmYxZGU2NGU5YWI5YTJkMGVjN2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.gRs1RKXfj6QOz88vf-EoNI5vpqZ85oKMTsEfY6KLJto)
Device Information
Additional context
I am using insertLink method under roosterjs-content-model-api
Any help or direction would be appreciated
The text was updated successfully, but these errors were encountered: