Skip to content
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

add RTL support #1799

Merged
merged 2 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" />;
});
Loading