I got to trim pasted value with JavaScript. The way I see it I got 2 options:
- Either replace the content of clipboard with trimmed text or prevent event from continuing with
event.preventDefault()
and putting the trimmed value into the component myself. - replacing clipboard data with
event.clipboardData.setData('text/plain', pastedText.trim())
didn't work.
Any ideas about those options?