Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Latest commit

 

History

History
29 lines (17 loc) · 864 Bytes

README.md

File metadata and controls

29 lines (17 loc) · 864 Bytes

automatic-direction

A lightweight Javascript Library for automatic direction change of input between rtl and ltr based on character count.

HTML5 dir="auto" attribution is good, but it just depends on first character in most browsers ,that is not functional on most arabic and persian web applications.

Demo link

How to use

Include automatic-direction.js in bottom of the page before body close tag

<script src="js/automatic-direction.js"></script>

add .dir-auto class to input that you want to automate direction on it

<textarea class="dir-auto" ></textarea>

Licence and Credits

The code and the documentation are released under the MIT License

By Milad Dehghan

Thanks to @sallar for converting it to Vanilla js