How can I prevent a SpeedDialAction that opens dialog from refocusing the SpeedDial when the dialog is closed? - material-ui

I have a SpeedDialAction (#material-ui/lab#4.0.0-alpha.56) that opens a file dialog. If you choose one or more files it opens a material-ui modal dialog. It's using react-dropzone, but I don't know if that's relevant here. At the beginning of the action click handler I set the open state on the SpeedDial to false, and it closes. When you:
cancel the file dialog
cancel the material-ui dialog
submit from the material-ui dialog
...afterwards the SpeedDial component's onOpen callback is called, and passed 'focus' as the reason. I'm not sure why this is happening or really which component is driving this behavior. Is there an easy way to suppress this?

The answer is in the docs: the disableRestoreFocus prop on Modal, which is inherited by Dialog.

Related

Material UI Tooltip title text content has a button that opens a dialog, dialog disappear after opening

I am trying to use the tooltip which has a title text content, say:
title={<>
Some text
<Button onClick={onOpen}>Click Me!</Button>
</>}
and that button's onClick will set the state to open a mui dialog, i've also set the Tooltip's interactive prop to be true. When the button inside the Tooltip's title content is click, the dialog pops up briefly then goes away. I believe that is also due to Tooltip fading away using the interactive prop.
Is there anyway to get the dialog to stay meanwhile having the tooltip title content disappear? Is material ui's tooltip component meant to be use this way?
Thanks for the help.

How to close Dialog using FlutterDriver

Is there any way to close a dialog by "tapping it away", i.e. tapping outside of the content to close it with Flutter Driver?
My problem is that the dialog does not have any buttons that would close it. Instead the user is expected to either tap outside of it or use the back button. However, FlutterDriver does not have a "back" option.
Hence, I am wondering how I would tap outside of the dialog in order to close it.
The key that is commonly used for modals in Flutter is ModalBarrier, which is why the following should do the trick:
await driver.tap(find.byType(ModalBarrier));
This will work as long as barrierDismissible is set to true.
Essentially, when tapping away a dialog in Flutter, you are tapping on the modal barrier, which is why above code works.
Thanks to John Muchow for finding out.
You would want to set the barrierDismissible property of the dialog to true and add a barrierLabel.
This will allow you to tap outside and close the dialog
https://api.flutter.dev/flutter/widgets/showGeneralDialog.html

How to prevent GWT dialogbox from closing when clicking outside it

I plan to add a menu that pop ups when a user performs a certain action. This menu will include some fields that the user will fill out and then hit "Submit" which will close the dialog box and update the client based on information inputed.
However, I want the user to be able to close the dialog window by hitting cancel or submit, and not by clicking on the screen outside of the dialog box.
How can i do this? Or maybe I should just use a PopupPanel?
It's as easy as setting the auto-hide behavior to false, either at construction time or later.

How can I make Dialog Box to hide when user clicks anywhere outside Dialog Box?

How can I make Dialog Box to hide when user clicks anywhere outside Dialog Box?
It is a GWT application where a view is extending Dialog Box. I have a Close button in Dialog Box which OnClicked hides the Dialog Box. However, as per requirement, if user clicks anywhere outside the Dialog Box, it should hide.
Any help would be greatly appreciated.
Thanks
Use the constructor DialogBox(boolean autoHide) or the setter setAutoHideEnabled(boolean autoHide) in order to automatically hide the box when the user clicks outside of it.
You can also auto-hide on history token changes, using the setAutoHideOnHistoryEventsEnabled(boolean enabled) setter.

GWT-Google web Toolkit-DialogBox

I have doubt regarding GWT .In Gwt if i click one button than it shows one dialog box at th same time the form outside the dialog box disabled.What component can be used for this task?
Thanks in advance
So, you want to open a popup dialog box, and at the same time disable the rest of the page until the user closes the dialog box?
If so, you can simply use gwt's DialogBox.
Use the constructor with the autohide flag set to false, and the box will not close until the user responds, thus disabling the rest of the page. If you want to make this even more clear, use the glass effect:
yourBox.setGlassEnabled(true);
You can also use the PopupPanel directly and build your own custom dialog box.
Now, if I got it wrong and you want to disable the form so it remains disabled after the popup, just disable it in the onClick handler of the button that opens the box.