kendoNumericTextBox draggable

2 Answers 19 Views
NumericTextBox
CHRISTOPHER
Top achievements
Rank 1
Iron
Iron
CHRISTOPHER asked on 01 May 2025, 06:57 PM
  1. This is the console display of my numeric textbox with draggable = false. When inspecting the DOM in chrome, the attribute shows up on the input you dynamically create. However, if I select the whole number with my mouse it can easily still drag the number into a neighboring textarea. I need to be able to cut, copy, paste on both of these controls. Is there a way to force Chrome to not allowing dragging here?
  2.  
  3.  
  4. {prefix: '', name: 'NumericTextBox', decimals: 2, autoAdjust: true, enable: true, …}
    1. autoAdjust: true
    2. culture: ""
    3. decimals: 2
    4. downArrowText: "Decrease value"
    5. draggable: false
    6. enable: true
    7. factor: 1
    8. fillMode: "solid"
    9. format: "0.00"
    10. label: null
    11. max: null
    12. min: null
    13. name: "NumericTextBox"
    14. placeholder: undefined
    15. prefix: ""
    16. prefixOptions: {separatortrue}
    17. restrictDecimals: false
    18. round: true
    19. rounded: "medium"
    20. selectOnFocus: true
    21. size: "medium"
    22. spinners: false
    23. step: 1
    24. suffixOptions: {separatortrue}
    25. upArrowText: "Increase value"
    26. value: null
    27. [[Prototype]]: Object

2 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 06 May 2025, 07:11 AM

Hello Christopher,

I would suggest trying the suggestions provided in the StackOverflow thread linked below:

- https://stackoverflow.com/questions/46071847/prevent-dragging-and-dropping-text-selections-between-inputs 

In the Dojo linked here, I used the following :

  • Adding `ondrop="return false;"` to the textarea allows dragging from the NumericTextBox, but prevents dropping in the textarea
  • Adding the following line prevents dragging from the NumericTextBox:
window.addEventListener(`dragstart`, (event) => event.preventDefault());

Please review the example and let me know in case you have any additional quetsions on the matter.

Regards,
Neli
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
CHRISTOPHER
Top achievements
Rank 1
Iron
Iron
answered on 08 May 2025, 12:51 PM
The ondrop worked perfectly.  thanks!
Tags
NumericTextBox
Asked by
CHRISTOPHER
Top achievements
Rank 1
Iron
Iron
Answers by
Neli
Telerik team
CHRISTOPHER
Top achievements
Rank 1
Iron
Iron
Share this question
or