Skip to content

Commit

Permalink
added RTL support
Browse files Browse the repository at this point in the history
  • Loading branch information
adueck committed Jul 26, 2024
1 parent 95966f6 commit 1b19240
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions frontend/apps/remark42/app/components/auth/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ export function Auth() {
const element = evt.target as HTMLInputElement;
element.value = element.value.trim();
}}
dir="auto"
/>
</div>
{view === 'email' && (
Expand All @@ -345,6 +346,7 @@ export function Auth() {
type="email"
placeholder={intl.formatMessage(messages.emailAddress)}
disabled={isLoading}
dir="auto"
/>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ export class CommentForm extends Component<Props, State> {
disabled={isDisabled}
autofocus={!!autofocus}
spellcheck={true}
dir="auto"
/>
</TextExpander>
{charactersLeft < 100 && <span className="comment-form__counter">{charactersLeft}</span>}
Expand Down Expand Up @@ -518,6 +519,7 @@ export class CommentForm extends Component<Props, State> {
className="comment-form__preview raw-content"
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{ __html: preview }}
dir="auto"
/>
</div>
)
Expand Down
3 changes: 2 additions & 1 deletion frontend/apps/remark42/app/components/comment/comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export class Comment extends Component<CommentProps, State> {
if (props.view === 'preview') {
return (
<article className={b('comment', { mix: props.mix }, defaultMods)}>
<div className="comment__body">
<div className="comment__body" dir="auto">
{!!o.title && (
<div className="comment__title">
<a className="comment__title-link" href={`${o.locator.url}#${COMMENT_NODE_CLASSNAME_PREFIX}${o.id}`}>
Expand Down Expand Up @@ -477,6 +477,7 @@ export class Comment extends Component<CommentProps, State> {
ref={this.textNode}
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{ __html: o.text }}
dir="auto"
/>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ export const TextareaAutosize = forwardRef<HTMLTextAreaElement, Props>(({ onInpu
}
}, [value, ref]);

return <textarea {...props} data-testid={props.id} onInput={handleInput} value={value} ref={ref} />;
return <textarea {...props} data-testid={props.id} onInput={handleInput} value={value} ref={ref} dir="auto" />;
});

0 comments on commit 1b19240

Please sign in to comment.