html-editor-enhanced icon indicating copy to clipboard operation
html-editor-enhanced copied to clipboard

[BUG] Editor take the focus instead of a dialog that overlay it

Open jdayssol opened this issue 2 years ago • 5 comments

Describe the bug

when I have a alertDialog that overlap the editor, the mouse still change to a text cursor and when I click on my dialog the focus go to my editor that is behind it.

To Reproduce Add a button to add a AlertDialog in the main.dart, in this dialog have a IconButton . When clicking on the IconButton, there is no effect.

Expected behavior The focus stay on the dialog

jdayssol avatar Jan 18 '23 14:01 jdayssol

Screenshot 2023-01-18 at 15 11 32

jdayssol avatar Jan 18 '23 14:01 jdayssol

In this screenshot it is impossible to close the dialog by clicking on the close button. If you change the height of the editor to make it smaller , the close button is then clickable...

In the main.dart file example, add:

IconButton( onPressed: () { showDialog( context: context, builder: (BuildContext context) { return AlertDialog( title: SizedBox( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text("Dialog"), IconButton( onPressed: (() { print("Close"); Navigator.pop(context); }), icon: const Icon(Icons.close), ) ], )), scrollable: true, content: SizedBox(), ); }); }, icon: const Icon(Icons.settings), ), HtmlEditor(....

jdayssol avatar Jan 18 '23 14:01 jdayssol

Any idea how I can solve this problem?

jdayssol avatar Mar 01 '23 12:03 jdayssol

The solution is to use PointerInterceptor in the code invoking the dialog https://pub.dev/packages/pointer_interceptor Still for flutter component where you cannot add this, it cause a problem, like the dateTimePicker open a dialog, and I cannot add this widget inside of it...

jdayssol avatar Mar 01 '23 14:03 jdayssol

same question PointerInterceptor is useful

hakama99 avatar May 08 '24 02:05 hakama99