Web: Components: Fix cursor position in input in RTL mode

This commit is contained in:
Aleksandr Lushkin 2023-06-20 11:47:53 +02:00
parent 04d874ed1f
commit d9e0cfba4c
2 changed files with 3 additions and 0 deletions

View File

@ -55,6 +55,7 @@ const commonInputStyle = css`
props.theme.interfaceDirection === "rtl" &&
css`
// If current interface direction is rtl, set cursor in the right side of the input
// Will work only if placeholder exists (placeholder=" " by default required)
:placeholder-shown {
direction: rtl;
}

View File

@ -72,6 +72,8 @@ TextInput.propTypes = {
TextInput.defaultProps = {
type: "text",
// Empty placeholder by default needed for RTL mode to make :placeholder-shown work to put cursor on the right side of input
placeholder: " ",
value: "",
maxLength: 255,
size: "base",