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

Dialog: Only focus the dialog if mousedown is not in the titlebar close button #828

Closed
wants to merge 40 commits into from

Conversation

kborchers
Copy link
Member

I would appreciate a review of this before I merge it since it feels dirty but I thought for way too long about a different way to do this and couldn't come up with one. Just want to make sure I didn't miss anything obvious.

…he dialog if there is nothing yet in the dialog content. Partial fix for:
…fault null, as it should be. No back-compat, as the behaviour doesn't change.
… refactoring _setOption, no need for switch.
…d for the uiDialog closure. Use this.uiDialog and remove the variable.
… instead. Wasn't needed anymore (previous refactorings).
…. Fixes #6830 - Allow Icons to be specified for Dialog buttons.
@jzaefferer
Copy link
Member

Makes sense to me. @scottgonzalez what do you think?

@mikesherov
Copy link
Member

I suppose you can delegate the mousedown, and cancel the event when it bubbles to .ui-dialog-titlebar-close, otherwise allow focus to happen. Would that be a better alternative? Again, I'm just getting up to speed here, so if my suggestion makes no sense... ignore it. :-)

@mikesherov
Copy link
Member

I would also ask, as I always do, if there's a unit test you can write for this.

@scottgonzalez
Copy link
Member

I haven't dug into the details here. Do we know why focusing causes the shift?

@kborchers
Copy link
Member Author

It seems like it may be something with the size of the dialog changing and then regaining focus causes position to do a fit.

@jzaefferer
Copy link
Member

This addresses http://bugs.jqueryui.com/ticket/8789 - right? The commit message should include that.

@kborchers
Copy link
Member Author

The commit message does include that, I just didn't copy it all into the PR message.

@mikesherov
Copy link
Member

@scottgonzalez I'd like to land this as it now fixes two bugs: 8838. Are we ok with the approach here?

@jzaefferer
Copy link
Member

We still don't know what is actually causing the two issues. The fiddle involving tabs can probably reduced further as well.

@mikesherov
Copy link
Member

@jzaefferer, are you saying not to land this until we figure out the root cause? I'm not opposed to that, I'm just trying to figure out the status of this PR.

@jzaefferer
Copy link
Member

Yes, I want to dig further into this.

Also an alternative solution might be to reposition the dialog when the
height option is changed. That seems to make more sense and would avoid
this issue.

@kborchers
Copy link
Member Author

Following @jzaefferer's recommendation, this new commit repositions after resize. It appears to fix the issue in a much simpler way. Only problem is I can't seem to replicate the issue as a unit test. Simulating mousedown on the close button doesn't cause it to reposition like it does with actual mouse interactions.

@mikesherov
Copy link
Member

@kborchers, use firebug and monitorEvents() to see the events you need to simulate to faithfully reproduce this. That's what I did when I was have trouble with the same on my last commit.

@mikesherov
Copy link
Member

@kborchers, does the new commit also address 8839? That may be simpler to write a test for.

@scottgonzalez
Copy link
Member

The new implementation seems better. I'm ok with landing that.

@kborchers
Copy link
Member Author

OK, I have updated that commit to include a test so hopefully this can land now.

@jzaefferer jzaefferer closed this Nov 26, 2012
@jzaefferer
Copy link
Member

Thanks Kris. I saw this after merging your previous commit, so added the test in a68d5ca.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants