For my website, i need to provide arabic support. Part of it is to provide input textboxes where when user types in, the new characters have to be appended to the left and t
Here's what I can think of:
direction:RTL
for the RIGHT alignmentA feature specific to Angular Material, in addition to direction: rtl, is :
.mat-form-field {
text-align: start!important;
}
This will work for both RLT & LTR
function rtl(element)
{
if(element.setSelectionRange){
element.setSelectionRange(0,0);
}
}
<input type="text" name="textbox" style="direction:RTL;" onkeyup="rtl(this);"/>
This code will do.
You can use the dir="rtl" on the input. It is supported.
<input dir="rtl" id="foo"/>
Use on the input in css.
input {
unicode-bidi:bidi-override;
direction: RTL;
}
It works for Chrome browser.
Use a div element and make it editable.
<div contenteditable="true">
</div>