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

HTML Editor not disposing the dialog #157

Closed
iamkunalpitale opened this issue Nov 1, 2021 · 9 comments
Closed

HTML Editor not disposing the dialog #157

iamkunalpitale opened this issue Nov 1, 2021 · 9 comments
Labels
question Further information is requested

Comments

@iamkunalpitale
Copy link

Screenshot 2021-11-01 at 4 01 04 PM

How do i click the dialog button (HTML editor not disposing in the background)
@iamkunalpitale iamkunalpitale added the question Further information is requested label Nov 1, 2021
@tneotia
Copy link
Owner

tneotia commented Nov 1, 2021

Since you are using Flutter Web, you need to use the pointer_interceptor package. Wrap your AlertDialog with PointerInterceptor and then you can click on the yes / no buttons.

Just FYI, any widget that is interactable and will display on top of the editor, you need to wrap with this PointerInterceptor.

@boganiLuca
Copy link

boganiLuca commented Feb 15, 2022

Hello, is this issue still resolvable by wrapping the interactable widgets inside a PointerInterceptor? I thought I solved this issue as suggested like 2 months ago, but then I had to drop the project for a while, and now that I resumed working on it, I can't seem to make it work. As suggested here and on the pointer_interceptor page, I both wrapped my Drawer and an AlertDialog (which are the only widgets that would appear above the HTML editor), but both of them won't receive inputs

EDIT: I opened a new issue here

@tneotia
Copy link
Owner

tneotia commented Feb 15, 2022

Hello, is this issue still resolvable by wrapping the interactable widgets inside a PointerInterceptor? I thought I solved this issue as suggested like 2 months ago, but then I had to drop the project for a while, and now that I resumed working on it, I can't seem to make it work. As suggested here and on the pointer_interceptor page, I both wrapped my Drawer and an AlertDialog (which are the only widgets that would appear above the HTML editor), but both of them won't receive inputs

As far as I know it should be working by wrapping the widget, so you may be correct that it is a Flutter bug.

@iamkunalpitale
Copy link
Author

Yes, it has been solved with PointerInterceptor

@alexandersidum
Copy link

In my case when clicking insert link on toolbar it shows dialog on top of the html editor, how do i wrap this default dialog from the package, cant seem to find way to customize it.

@alexandersidum
Copy link

alexandersidum commented Mar 24, 2022

In my case when clicking insert link on toolbar it shows dialog on top of the html editor, how do i wrap this default dialog from the package, cant seem to find way to customize it.

Nevermind , i found it on #69
But putting pointer interceptor solution doesnt seems to work, since i still cant click the field on insert link dialog and whenever i type something it typed on html editor field instead.

Edit :
Seems to be related to this issue

@rutaba1
Copy link

rutaba1 commented Apr 3, 2022

Happening for me as well. I have a customised dialog for adding the link but I can't seem to access the Url text field here

Screenshot 2022-04-03 at 11 15 25 PM

Here's the code for the custom dialog:

Future<bool> linkDialog() async {
    final text = TextEditingController();
    final url = TextEditingController();
    final textFocus = FocusNode();
    final urlFocus = FocusNode();
    final formKey = GlobalKey<FormState>();
    await showDialog(
        context: context,
        builder: (BuildContext context) {
          return PointerInterceptor(
            child: AlertDialog(
              title: Text('Insert Link'),
              scrollable: true,
              content: Form(
                key: formKey,
                child: Column(
                  mainAxisSize: MainAxisSize.min,
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text('Text to display',
                        style: TextStyle(fontWeight: FontWeight.bold)),
                    SizedBox(height: 10),
                    TextField(
                      controller: text,
                      focusNode: textFocus,
                      textInputAction: TextInputAction.next,
                      decoration: InputDecoration(
                        border: OutlineInputBorder(),
                        hintText: 'Text',
                      ),
                      onSubmitted: (_) {
                        urlFocus.requestFocus();
                      },
                    ),
                    SizedBox(height: 20),
                    Text('URL', style: TextStyle(fontWeight: FontWeight.bold)),
                    SizedBox(height: 10),
                    TextFormField(
                      controller: url,
                      focusNode: urlFocus,
                      textInputAction: TextInputAction.done,
                      decoration: InputDecoration(
                        border: OutlineInputBorder(),
                        hintText: 'URL',
                      ),
                      validator: (String value) {
                        if (value == null || value.isEmpty) {
                          return 'Please enter a URL!';
                        }
                        return null;
                      },
                    ),
                  ],
                ),
              ),
              actions: [
                TextButton(
                  onPressed: () {
                    setState(() {
                      showNotesUI = true;
                    });
                    Navigator.of(context).pop();
                  },
                  child: Text('Cancel'),
                ),
                TextButton(
                  onPressed: () async {
                    if (formKey.currentState.validate()) {
                      controller.insertLink(
                        text.text.isEmpty ? url.text : text.text,
                        url.text,
                        true,
                      );
                      setState(() {
                        showNotesUI = true;
                      });
                      Navigator.of(context).pop();
                    }
                  },
                  child: Text('OK'),
                )
              ],
            ),
          );
        });
    return false;
  }

@tneotia
Copy link
Owner

tneotia commented Apr 6, 2022

Hi @rutaba1 , this seems to be an issue in Flutter. What Flutter version are you using?

@FlyBoyA
Copy link

FlyBoyA commented Apr 5, 2023

Is the dialog box issue resolved ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants