Pickers in Popups

I have a popup that includes a picker (I tried several kinds). When I click the picker button, popupShown is called again on my popup window.

Am I doing something wrong or is there a way around this?

Comments

  • Hi @Kloodge, it's hard to say without seeing exactly what you're doing, though it sounds similar to the issue we're trying to fix with https://github.com/enyojs/enyo/pull/1003. Do you have an example of what you're trying to do that you can throw together i.e. on jsfiddle? Thanks!
  • edited March 2015
    Here it is:

    http://jsfiddle.net/Kloodge/s9t4spvq/24/

    I've never used JSFiddle before. It runs on the page where I wrote it, but when I go to the share link, it doesn't seem to run.

    Edit: Apparently it doesn't like "https". The above link should work now.

    Edit 2: Checking 'inEvent.originator == this' in the onShow gets around the problem, but I can't help but think I'm doing something wrong.
  • edited March 2015
    Hi @Kloodge, thanks for creating the fiddle! onyx.DatePicker contains onyx.Menu controls for each of the date components - these controls inherit from enyo.Popup, so they also emit the onShow event, which bubbles up and is handled by your specified handler. Checking the originator seems perfectly acceptable here - I'll double-check to see if there are any other practices you might employ.
  • Thanks. It's working fine now.

    This is a fairly complex "widget editor" that dynamically fills with editing controls (color pickers, etc.) to live-edit canvas-based graphic controls. I'm using onShow to make some final adjustments to the popup that can't be made until everything is laid out.

    Is there a better place to do this?
  • Hi @Kloodge, have you tried making these final adjustments in the rendered lifecycle function, like so:
    
    rendered: function () {
    			this.inherited(arguments);
    			// your final adjustment code here
    		}
    
Sign In or Register to comment.