-
Notifications
You must be signed in to change notification settings - Fork 336
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: Enter Key Functionality in the Response Editor when @ symbol is … #10699
fix: Enter Key Functionality in the Response Editor when @ symbol is … #10699
Conversation
Hi @Dschoordsch, please review this PR |
@Dschoordsch Please have a look at this PR |
component?.destroy() | ||
if (props.event.key === 'Enter') { | ||
if (teamMembersFiltered.length === 0) { | ||
return false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1 I think you were on the right path here and I wouldn't have found it that quickly without this, but I think we shouldn't modify this component. Keeping a reference to the filtered elements also feels a bit hacky. Instead I think the error lies in the component
, namely the enterHandler
in MentionDropdown
. We should check there if the selectedIndex
is out of bounds of items
and return false
. In the onKeyDown
handler we have to return that value. This way we can get away without keeping the additional reference to the teamMembersFiltered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are right, I will give it a try
86cf426
to
f098784
Compare
@Dschoordsch Yes, adding the checks in the enterHandler keeps things, clean. Thanks for the suggestion. I have made the changes. Please review it again. Let me know if I am missing anything. |
Please re-request review next time you need another pass (the refresh button next to the reviewer name), otherwise it might get forgotten. |
Description
Fixes #10698
This MR addresses a bug in the Enter key functionality when typing "@" symbols followed by text in the editor. Specifically:
Demo
Screen.Recording.2025-01-17.at.1.19.16.AM.mov
Testing Scenarios
Please validate the following scenarios to ensure the fix is comprehensive:
Scenario 1: Type "@" and select a username from the popup. Verify that hitting Enter selects the user as expected.
Scenario 2: Type "@" followed by text with no matching user and hit Enter. Ensure the cursor moves to the next line.
Scenario 3: Validate that no regressions occur with existing mention functionality:
Final checklist