Photoshop CC 2015.1.2: Issue with .onChange for eddittext in JSX scripts

  • 2
  • Problem
  • Updated 2 years ago
  • Solved
  • (Edited)
I'm not sure is this was an intended change or a bug in CC 2015.1.2. I'm hoping someone from Adobe can clarify if this is a bug or an intended change to the javascript engine. If this was an intended change then I'll want to reprogram all of my scripts.

Here is what is going on (only tested on Windows 10)........

I have a bunch of scripts that use the .onChange event for edittext boxes. When a numerical value is typed in and the user presses "Enter", this would trigger the .onChange function for the script. The .onChange functions use the new edittext values to apply changes to the image. This has worked fine from CS3 all the way through 2015.1.1. In 2015.1.2, the Enter key will not trigger the .onChange event. It just makes a beeping sound.

Is the Enter key is now solely dedicated to "OK" buttons? For my scripts, they don't have OK buttons in order to avoid any "Enter" key conflicts with the edittext boxes. I have it setup to apply the changes with the edittext changes. There is then a regular button set up to close the dialog when the user is done but not any OK buttons tied to the enter key.

Anyway, I'd really appreciate some feedback to let me know if this is a bug or something that is reprogrammed to be a permanent change. That way I can redesign my scripts accordingly.

Thanks, Damon
Photo of Damon Bell

Damon Bell

  • 19 Posts
  • 1 Reply Like

Posted 3 years ago

  • 2
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 14170 Posts
  • 1773 Reply Likes
Hi Damon,

I'll have our Script UI guy follow up with you. I believe the change was intentional.
Photo of Eric Ching

Eric Ching, Employee

  • 86 Posts
  • 48 Reply Likes
Hi Damon,

This is a bug that affects Windows - Mac is working correctly. Using the onEnterKey handler on the edit text field should work as a temporary workaround until we can get the fix out.

Thanks for reporting this!

Eric
Photo of Damon Bell

Damon Bell

  • 19 Posts
  • 1 Reply Like
Thank you Eric. That works perfectly. I didn't even know about the onEnterKey handler. That is an easier workaround then what I was planning to do.
Photo of Damon Bell

Damon Bell

  • 19 Posts
  • 1 Reply Like
OK, now it seems the .onEnterKey double triggers the event in CC 2015.1.2. I don't think it was doing this until today. I thought that CC 2015 updated today but it still shows 2015.1.2. Maybe it was a prior version but I thought for sure Creative Cloud was updating CC 2015.

Anyway, I tested by having the onEnterKey function do nothing except alert a message. The message always alerts twice in a row. In CS6, the message only alerts once.
Photo of Damon Bell

Damon Bell

  • 19 Posts
  • 1 Reply Like
OK, I did confirm that the onEnterKey double runs the event function on another Windows computer.  However, I was wrong about it being due to an update.  The other computer was running 2015.1.2 as well and it said it needed an update.  I tested before and after the update and it double ran the onEnterKey function both before and after the update.  The update was only for a Camera Raw update and the version was still 2015.1.2 after the update.

I also tested  on Mac and the onEnterKey works fine and only runs the event function once.

I guessing this is related to the same onChange issue.  However, I figured you'd want to know about it just in case.
(Edited)
Photo of Eric Ching

Eric Ching, Employee

  • 86 Posts
  • 48 Reply Likes
Thanks for the update Damon, we'll look into this.  I'll update with any potential workarounds.

Eric
Photo of Damon Bell

Damon Bell

  • 19 Posts
  • 1 Reply Like
Thanks Eric.  I already have a workaround. I just wanted to make sure you knew about the onEnterKey issue.

For the workaround I just assign the edittext numerical value to a variable at the end of the function.  The onEnterKey function compares the edittext number to the variable.  It will only run if the edittext number is different than the variable.  That way it only runs the first time.
(Edited)
Photo of Eric Ching

Eric Ching, Employee

  • 86 Posts
  • 48 Reply Likes
Hi Damon,

We've reproduced the issue and will do our best to get a fix in for the next release.

Thanks,
Eric
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 14170 Posts
  • 1773 Reply Likes
Official Response