Skip to content

Fix newline characters not being typed into textareas#61

Open
kevinsimler wants to merge 2 commits intoVibiumDev:mainfrom
kevinsimler:textarea-newlines
Open

Fix newline characters not being typed into textareas#61
kevinsimler wants to merge 2 commits intoVibiumDev:mainfrom
kevinsimler:textarea-newlines

Conversation

@kevinsimler
Copy link
Copy Markdown

WebDriver BiDi requires carriage return (\r) to produce the Enter key, not newline (\n). Text containing \n was being typed without line breaks / line breaks were being dropped.

  • Add NormalizeKeyChar helper in internal/bidi/keys.go
  • Apply conversion in both input.go (CLI) and router.go (WebSocket API)
  • Add newline tests for JS async API and CLI

@hugs
Copy link
Copy Markdown
Contributor

hugs commented Feb 8, 2026

to fix this issue, should we be sending \uE006 instead? including a link to where to relavent sections of the WebDriver or WebDriver BiDi spec would also be helpful to folks reading this later.

WebDriver BiDi requires carriage return (\r) to produce the Enter key,
not newline (\n). Text containing \n was being typed without line breaks.

- Add NormalizeKeyChar helper in internal/bidi/keys.go
- Apply conversion in both input.go (CLI) and router.go (WebSocket API)
- Add newline tests for JS async API and CLI
Rename NormalizeKeyChar to ConvertToKeyChar to better reflect its
purpose: mapping string literal characters (e.g. \n) to their
WebDriver BiDi keyboard equivalents (e.g. \uE006 Return key).
Also switch from \r to the canonical WebDriver Return key code.
@kevinsimler
Copy link
Copy Markdown
Author

I think you're right that \uE006 (or \uE007) is a better choice than \r. Since Vibium is converting the string passed into type() into keyDown/keyUp actions, we should use characters that map directly to keys whenever possible

Addressed in b2eeaae

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.

2 participants