This is a migrated thread and some comments may be shown as answers.

Copy Content From Disabled NumericTextBox

2 Answers 146 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
nevra
Top achievements
Rank 1
nevra asked on 10 Sep 2020, 09:06 AM

Hi,

I want to activate to copy numerictextbox value content, when user double click and component is disabled. How can I do?

I try to add some properties to input tag, but does not work.

input {
 user-select: text;
-webkit-user-drag: none;
}

https://www.telerik.com/kendo-angular-ui/components/inputs/numerictextbox/disabled-state/#toc-disabled-numerictextbox

2 Answers, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 11 Sep 2020, 02:07 PM

Hello Nevra,

Thanks for the provided details.

By design the NumericTextBoxComponent tries to mimic the behaviour of the native <input> element as close as possible.

Let me clarify - when an <input> is marked as disabled, it becomes unusable and unclickable. More info can be found here - https://www.w3schools.com/tags/att_input_disabled.asp. On the other hand if an <input> is marked as read-only, it becomes immutable, but its contents can be selected. Again, here is a link with further explanations - https://www.w3schools.com/tags/att_input_readonly.asp.

With that in mind, the NumericTextBoxComponent has a readonly input which behaves as the native <input>'s attribute. Here is an example demonstrating it in action - https://www.telerik.com/kendo-angular-ui/components/inputs/numerictextbox/readonly-state/

I hope this helps. Please let me know if further assistance is needed.

Regards,
Petar
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/.

0
nevra
Top achievements
Rank 1
answered on 11 Sep 2020, 02:22 PM
Hi Petar,

Thanks for detailed information. Yes, it is possible to clickable input with readonly tag. From another point of view, I solved the problem by changing .k-state-disabled class.

https://stackblitz.com/edit/angular-ugtqez?file=app/app.component.scss
Tags
NumericTextBox
Asked by
nevra
Top achievements
Rank 1
Answers by
Petar
Telerik team
nevra
Top achievements
Rank 1
Share this question
or