Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should Dialog have a "tapToClose" option? #427

Closed
samreid opened this issue Jan 2, 2019 · 9 comments
Closed

Should Dialog have a "tapToClose" option? #427

samreid opened this issue Jan 2, 2019 · 9 comments

Comments

@samreid
Copy link
Member

samreid commented Jan 2, 2019

During phetsims/molecules-and-light#185 @zepumph and I noticed that Molecules and Light has a feature where tapping the dialog dismisses it:

// close it on a click
var self = this;
var buttonListener = new ButtonListener( {
  fire: self.hide.bind( self )
} );
this.addInputListener( buttonListener );

Should this feature be in SUN/Dialog? Alternatively, should we remove this feature from Molecules and Light?

@pixelzoom
Copy link
Contributor

No, I don't think this should be support by Dialog. Standard behavior should be:
(1) click the close button to close the dialog
(2) clicking anywhere outside the dialog is the same as clicking the close button

Yes, I would remove this feature from MAL.

@pixelzoom pixelzoom removed their assignment Jan 3, 2019
@jessegreenberg
Copy link
Contributor

jessegreenberg commented Jan 3, 2019

I also vote to remove this, I think it is odd to close a dialog by clicking inside of it.

But I see those exact lines in FluorescentCellsPictureDialog (gene-expression-essentials), AboutDialog, UpdateDialog, and EnergyGraphNode (MAS), so it should be removed from all of those.

@ariel-phet are you OK with removing this from all of those dialogs?

@ariel-phet
Copy link

@jessegreenberg I am OK with removing from all those dialogs

@ariel-phet ariel-phet removed their assignment Jan 3, 2019
@samreid samreid self-assigned this Jan 3, 2019
jessegreenberg added a commit to phetsims/molecules-and-light that referenced this issue Jan 4, 2019
jessegreenberg added a commit to phetsims/gene-expression-essentials that referenced this issue Jan 4, 2019
jessegreenberg added a commit to phetsims/joist that referenced this issue Jan 4, 2019
jessegreenberg added a commit to phetsims/joist that referenced this issue Jan 4, 2019
jessegreenberg added a commit to phetsims/masses-and-springs that referenced this issue Jan 4, 2019
@jessegreenberg
Copy link
Contributor

OK, this has been removed from the Dialogs mentioned in #427 (comment). @samreid is there anything more to do for this issue?

@samreid
Copy link
Member Author

samreid commented Jan 11, 2019

@jessegreenberg what's this occurrence in KeyboardHelpDialog? I'm not familiar with "click":

    // @private (a11y) - input listener for the close button, must be disposed
    var clickListener = {
      click: function() {
        self.hide();
        self.focusActiveElement();
      }
    };
    this.addInputListener( clickListener );

@samreid
Copy link
Member Author

samreid commented Jan 11, 2019

@pixelzoom I found 2 more occurrences like this in Equality Explorer: in OopsDialog and InfoDialog:

    // Click anywhere on the dialog to hide it.
    this.addInputListener( new ButtonListener( {
      fire: function() { self.hide(); }
    } ) );

Would you like me to remove them?

Also a heads-up that hide might get changed to setVisible(false) as part of #369 (comment)

@samreid samreid assigned pixelzoom and jessegreenberg and unassigned samreid Jan 11, 2019
pixelzoom added a commit to phetsims/equality-explorer that referenced this issue Jan 11, 2019
@pixelzoom
Copy link
Contributor

Remove from Equality Explorer in the above commit.

@pixelzoom pixelzoom removed their assignment Jan 11, 2019
@jessegreenberg
Copy link
Contributor

Thanks @samreid, removed #427 (comment). click is the event when a button is clicked. This was added when KeyboardHelpDialog had a custom close button, but now it uses the one in Dialog.

@jessegreenberg jessegreenberg removed their assignment Jan 11, 2019
@samreid
Copy link
Member Author

samreid commented Feb 5, 2019

Looks great, thanks! I can't find any other occurrences of this pattern, closing.

@samreid samreid closed this as completed Feb 5, 2019
jessegreenberg added a commit to phetsims/greenhouse-effect that referenced this issue Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants