AutosuggestInput/AutosuggestTextarea: fix RTL detection with placeholder

environments/review-threads-rt-b8dvls/deployments/1838
Alex Gleason 2022-12-23 16:14:50 -06:00
rodzic c4270a0512
commit bedd181f4c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -269,7 +269,7 @@ export default class AutosuggestInput extends ImmutablePureComponent<IAutosugges
const visible = !suggestionsHidden && (!suggestions.isEmpty() || (menu && value));
// TODO: convert to functional component and use `useLocale()` hook instead of checking placeholder text.
if (isRtl(value) || (placeholder && isRtl(placeholder))) {
if (isRtl(value) || (placeholder && isRtl(placeholder) && !value)) {
style.direction = 'rtl';
}

Wyświetl plik

@ -230,7 +230,7 @@ class AutosuggestTextarea extends ImmutablePureComponent<IAutosuggesteTextarea>
const style = { direction: 'ltr', minRows: 10 };
// TODO: convert to functional component and use `useLocale()` hook instead of checking placeholder text.
if (isRtl(value) || (placeholder && isRtl(placeholder))) {
if (isRtl(value) || (placeholder && isRtl(placeholder) && !value)) {
style.direction = 'rtl';
}