-
Notifications
You must be signed in to change notification settings - Fork 191
Fixes for Editor switching to next field on pressing Enter #2457
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
base: main
Are you sure you want to change the base?
Fixes for Editor switching to next field on pressing Enter #2457
Conversation
…t area specific to Body component in Execution Create
WalkthroughAdded a wrapper div around two Body InputTextarea components with Possibly related issues
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/execute-function/+page.svelte (1)
179-191
: Simplify the wrapper and verify the approach.The
stopPropagation
logic should prevent the Accordion from closing, but there are semantic and accessibility concerns:
- Semantic HTML:
role="textbox"
on a div wrapping a textarea is incorrect per ARIA guidelines—textarea is already a textbox. Remove therole
attribute.- Unnecessary wrapper attributes:
tabindex="-1"
on a non-interactive wrapper may confuse assistive technologies and isn't needed here.- Alternative approach: If
InputTextarea
supports Svelte event modifiers, consider placing the handler directly on the component.Consider this cleaner approach:
-<div - role="textbox" - tabindex="-1" - on:keyup={(e) => { - if (e.key === 'Enter') { - e.stopPropagation(); - } - }}> - <InputTextarea - placeholder="Enter request body here..." - id="body" - bind:value={body} /> -</div> +<div + on:keyup={(e) => { + if (e.key === 'Enter') { + e.stopPropagation(); + } + }}> + <InputTextarea + placeholder="Enter request body here..." + id="body" + bind:value={body} /> +</div>Please verify that Enter and Shift+Enter now allow new lines in the textarea without closing the Accordion or jumping focus.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/execute-function/+page.svelte
(2 hunks)
...ct-[region]-[project]/functions/function-[function]/executions/execute-function/+page.svelte
Show resolved
Hide resolved
placeholder="Enter request body here..." | ||
id="body" | ||
bind:value={body} /> | ||
</div> |
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.
Maybe we can add native key event support to Input.Textarea in appwrite/pink instead of wrapping it in a div ,
This would eliminate the need for wrapper divs 👍
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.
Hi @HarshMN2345 , Agree with the suggested change. I tried implementing that but was not able to make it work by passing the event inside textarea.

Any suggestions??
Currently trying by creating a CustomEvent and passing that inside Input.TextArea.
What does this PR do?
Fixes for Editor switching to next field on pressing Enter inside text area specific to Body component in Execution Create
Fixes appwrite/appwrite#10607
Test Plan
Reproduction Steps:
The cursor goes to the next line but the Accordion closes when user presses Enter key.
Check the attached recording for reference
Screen.Recording.2025-10-08.at.02.21.52.mov
Related PRs and Issues
Have you read the Contributing Guidelines on issues?
Yes
Summary by CodeRabbit