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
Conversation
…he dialog if there is nothing yet in the dialog content. Partial fix for:
…lements outside of it
…fault null, as it should be. No back-compat, as the behaviour doesn't change.
…date above that to access old option value.
… refactoring _setOption, no need for switch.
…tch (no fallthroughs).
…d for the uiDialog closure. Use this.uiDialog and remove the variable.
… instead. Wasn't needed anymore (previous refactorings).
…two keydown handlers into one.
…emoved outdated TODOs.
…. Fixes #6830 - Allow Icons to be specified for Dialog buttons.
… overhaul unit test for destroy method.
…ontent, then buttonpane, then close button, then dialog. Fixes #4731 - Dialog: Add option to set which element gains focus on open
…able methods. Disabling dialogs is not supported.
… check. Fixes #8824 - Deprecate array notation for position option.
…naddressable TODOs.
…r instead of appending to body.
Makes sense to me. @scottgonzalez what do you think? |
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. :-) |
I would also ask, as I always do, if there's a unit test you can write for this. |
I haven't dug into the details here. Do we know why focusing causes the shift? |
It seems like it may be something with the size of the dialog changing and then regaining focus causes position to do a fit. |
This addresses http://bugs.jqueryui.com/ticket/8789 - right? The commit message should include that. |
The commit message does include that, I just didn't copy it all into the PR message. |
@scottgonzalez I'd like to land this as it now fixes two bugs: 8838. Are we ok with the approach here? |
We still don't know what is actually causing the two issues. The fiddle involving tabs can probably reduced further as well. |
@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. |
Yes, I want to dig further into this. Also an alternative solution might be to reposition the dialog when the |
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. |
@kborchers, use firebug and |
@kborchers, does the new commit also address 8839? That may be simpler to write a test for. |
The new implementation seems better. I'm ok with landing that. |
…es not close for first click on chrome.
OK, I have updated that commit to include a test so hopefully this can land now. |
Thanks Kris. I saw this after merging your previous commit, so added the test in a68d5ca. |
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.