NumericTextBox - Right Align

1 Answer 117 Views
NumericTextBox
Tina
Top achievements
Rank 1
Tina asked on 04 Apr 2022, 12:00 PM

How do you right align input when displayed, and left align input on focus? 

1 Answer, 1 is accepted

Sort by
1
Hetali
Telerik team
answered on 05 Apr 2022, 03:21 PM

Hi Tina,

In order to right align the input when displayed and left align the input when in focus in the Kendo UI NumericTextBox, use the following CSS snippet:

.k-numerictextbox .k-input-inner {
  text-align: right;
}

.k-numerictextbox.k-focus .k-input-inner {
  text-align: left;
}

In this StackBlitz example, the NumericTextBox input is displayed on the right and when focused on the left. Please make sure to set the encapsulation to ViewEncapsulation.None to set the style locally.

I hope this helps.

Regards,
Hetali
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
NumericTextBox
Asked by
Tina
Top achievements
Rank 1
Answers by
Hetali
Telerik team
Share this question
or