espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.73k stars 741 forks source link

E.showMenu(): onchange method not called #2437

Closed nxdefiant closed 7 months ago

nxdefiant commented 7 months ago

With Bangle.js2 and firmware 2v19 up to 2v19.86 in the following code example basically taken from the tutorial

const settings = {};

E.showMenu({
    'How Many?': {
      value: 0|settings.howmany,  // 0| converts undefined to 0
      min: 0, max: 100, step: 1,
      onchange: v => {
        console.log("change");
      }
    },
  });

the onchange callback is not called when pressing the button. Last time seen working in firmware 2v18. Other menu variants (including setting max=10 in the above code) seem to work ok.

nxdefiant commented 7 months ago

Nevermind, seems to be the value needs to be confirmed with a touch, not button.

gfwilliams commented 7 months ago

Yes - it's perhaps an odd decision but all over the watch we use the button as 'back', so that's what it is here too