Picker On {close... not firing


#1

I have a picker that works fine on the desktop but the on close event does not fire when run in the simulator or on device (iPad Pro). Code for picker:

function open_picker() {	
var pickerMapCentre = app.picker.create({
  inputEl: '#map-centre-picker',
  on: {close: function () {
	  mapCentrePickedUp = pickerMapCentre.getValue();
	  Cookies.set('mapCentrePicked', mapCentrePickedUp, {expire:10000000}); //save selected location for future use when opening map
  }},
  cols: [
    {
      textAlign: 'left',
      values: ['Lechlade', 'Oxford', 'Benson', 'Reading', 'Maidenhead', 'Staines', 'Teddington', 'Westminster', 'Thames Barrier', 'Default']
    }
  ],
  toolbarCloseText: 'Save',	//ensure user knows what will happen!!!
});	
pickerMapCentre.open();
}

Any suggestions appreciated…


#2

Try to put console.log() to see, it should work totally fine


#3

Thanks for quick response - added console.log() but nothing reported…


#4

Go to http://framework7.io/kitchen-sink/core/?theme=ios

Write in console:

const picker = app.picker.create({
  on: {
    close() {
      console.log('Close');
    }
  }
});
picker.open();

Close picker by clicking on “Done” button.

You will see Close in console.

So there is some problem in your code


#5

Done some more tests and problem is outside of picker - sorry to have bothered you…