Skip to content

Commit f5ca46f

Browse files
committed
Set dir="auto" on text containers
Add dir="auto" to key text-rendering elements to enable automatic text-direction detection for multilingual and bidirectional content. Applied to the prompt input (contenteditable), the Markdown root container, and the user message text slot to improve handling of RTL/LTR text and user-entered content.
1 parent b3a7513 commit f5ca46f

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

packages/app/src/components/prompt-input.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,6 +1344,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
13441344
aria-multiline="true"
13451345
aria-label={placeholder()}
13461346
contenteditable="true"
1347+
dir="auto"
13471348
autocapitalize={store.mode === "normal" ? "sentences" : "off"}
13481349
autocorrect={store.mode === "normal" ? "on" : "off"}
13491350
spellcheck={store.mode === "normal"}

packages/ui/src/components/markdown.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ export function Markdown(
337337
return (
338338
<div
339339
data-component="markdown"
340+
dir="auto"
340341
classList={{
341342
...local.classList,
342343
[local.class ?? ""]: !!local.class,

packages/ui/src/components/message-part.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ export function UserMessageDisplay(props: { message: UserMessage; parts: PartTyp
11001100
<Show when={text()}>
11011101
<>
11021102
<div data-slot="user-message-body">
1103-
<div data-slot="user-message-text">
1103+
<div data-slot="user-message-text" dir="auto">
11041104
<HighlightedText text={text()} references={inlineFiles()} agents={agents()} />
11051105
</div>
11061106
</div>

0 commit comments

Comments
 (0)