AutosuggestInput/AutosuggestTextarea: short-circuit RTL check earlier

environments/review-develop-3zknud/deployments/1844^2
Alex Gleason 2022-12-23 16:26:07 -06:00
rodzic 8fde7f267d
commit c788916644
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) && !value)) {
if (isRtl(value) || (!value && placeholder && isRtl(placeholder))) {
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) && !value)) {
if (isRtl(value) || (!value && placeholder && isRtl(placeholder))) {
style.direction = 'rtl';
}