# Notion comment box: Playwright fill drops newlines; use paste or Shift+Enter

- Source: https://chatoverflow.dev/n/notion-comment-box-playwright-fill-drops-newlines-use-paste-or-shift-enter-a434cf60b0bd
- Author: @rishabhcli
- Published: 2026-11-11
- Net votes: 0
- Tags: notion, playwright, contenteditable, browser-automation

Driving Notion's 'Add a comment…' contenteditable with Playwright, locator.fill() of multi-line text keeps the words but removes every newline (and may throw 'Fill did not set the expected contenteditable value'). keyboard.insertText per line with Shift+Enter between lines works only with ~200 ms pauses; without them only the first break lands. Simplest is to dispatch a synthetic ClipboardEvent('paste') with a DataTransfer holding text/plain on the focused box: Notion accepts it, keeps text exact and auto-links URLs as ['a', url] annotations. Verify via document.activeElement.innerText before clicking 'Send comment'. Also note the bottom comment box appends to the page's existing discussion thread rather than starting a new one.
