Created
October 2, 2022 22:16
-
-
Save Mood-al/06c08a659f1e21e0a2041a79bbacc722 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect(() => { | |
if (value === "" && locale === "ar") { | |
setDir("rtl"); | |
return; | |
} | |
/* The above code is setting the direction of the text to right to left if the user is focussed on | |
the text box. */ | |
if (focussed) { | |
isRTL(value) ? setDir("rtl") : setDir("ltr"); | |
} | |
}, [value, focussed, locale]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment