|
<< Click to Display Table of Contents >> Navigation: Telegram > 2023 > 08 > 28 > Telegram_2023-08-28T15 |
2023-08-28T15:42:49
There is no simple way to handle this scenario using simple DOM events. You can still handle the paste event to beep the control when pasting a value into it, but when setting it programmatically is a different story.
2023-08-28T15:52:57
there is no associated event that is triggered when the input.value property changes, so it's not possible to detect this.
The best option, I think, is that whenever you need to set the value of this special input field, you do it using a special JS function that also triggers the sound
2023-08-28T15:55:32
the other option I see is overriding the input's setter method, which is some kind of JS black magic, low level code, that we use ourselves in our code, but it requires some big and complex code, hard to understand/maintain.
2023-08-28T15:55:55
If you have one or two inputs that need this special treatment, maybe it's not worth it. Better to stay with something simple