Hi All,
This may well be a problem with my code but since Photoshop was updated to 22.5 I’ve been having problems with text input in my plugin. When I have multiple fields one after another, the first field works fine, but then when I start to enter text in the following field, as soon as I hit space for the first time the text gets selected, and if I continue to type I lose the first word and the space. If I deselect the text that was automatically selected using the right arrow key on my keyboard, I can continue to type, with spaces, and the text is fine. It’s just the first space in the second field I type into in the plugin.
It was working find until PS 22.5, and I’ve spent the last three days trying to find the reason, a solution or a workaround, and I’m coming up blank. Here’s a screenshot of what happens when I hit that first space in the second text field. This also happens if I make the second text field a text area.
I’ve tried all kind of different ways to get the output from the textfield, and nothing I’ve tried makes any difference. Right now I’m using the following code.
document.querySelector("#presetDescInput").addEventListener('input', evt => {
tempDesc = evt.target.value;
})
document.querySelector("#presetDescInput").addEventListener('change', evt => {
tempDesc = evt.target.value;
})
I also tried removing the input event capture and just using the change event, but the issue still occurs.
If anyone has seen this and has a solution or knows a possible cause, I’d really appreciate your feedback. Also, if anyone has multiple text fields in your plugin, please try this scenario in Photoshop 22.5 to check that this is not a generic problem.
Regards,
Martin Bailey.