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

Editor for web app keeps showing "paste" dialog everytime in a read only content page from IOS web browser #1567

Closed
1 task done
Salvador-dev opened this issue Dec 5, 2023 · 33 comments
Labels
bug Something isn't working

Comments

@Salvador-dev
Copy link

Salvador-dev commented Dec 5, 2023

Is there an existing issue for this?

Flutter Quill version

8.6.4

Other Flutter Quill packages versions

No response

Steps to reproduce

i'm trying to use the widget in a flutter web app but this issue doesn't have solution since 2022 where another person have the same problem

Expected results

Don't show the dialog or only one time on the first time in the app.

Actual results

Showed the dialog every time.

Code sample

class ReadingDetailDialog extends StatefulWidget {
  final Reading reading;
  final User user;
  final BaseSubCategory? subCategory;

  const ReadingDetailDialog({
    super.key,
    required this.reading,
    required this.user,
    this.subCategory,
  });

  @override
  State<ReadingDetailDialog> createState() => _ReadingDetailDialogState();
}

class _ReadingDetailDialogState extends State<ReadingDetailDialog>
    with Notificable, Tools, UsesBreakpoints {
  final ReadingBloc _readingBloc;

  _ReadingDetailDialogState()
      : _readingBloc = getIt(),
        super();

  @override
  void initState() {
    _readingBloc.add(RequestOne(widget.reading.id));
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return DialogsLayout(
      padding: const EdgeInsets.symmetric(horizontal: 25),
      appBarLeadingWidget: _clientAppBarLeading,
      appBarTitle: _adminAppBarTitle,
      child: BlocBuilder<ReadingBloc, BaseState>(
        bloc: _readingBloc,
        builder: (context, state) {
          if (state is ItemLoaded<DetailedReading>) {
            return _getContent(state.item);
          } else if (state is BaseError) {
            return const TryAgainLaterScreen();
          }
          return LoadingScreen(resource: tr('fields.audio'));
        },
      ),
    );
  }

  Widget get _clientAppBarLeading => widget.user.isClient
      ? CustomDialogDefaults.clientAppBarLeading(
          widget.reading.id,
          getIt<ReadingFavoriteCubit>(),
        )
      : Container();

  Widget? get _adminAppBarTitle =>
      widget.user.isAdmin && widget.subCategory != null
          ? CustomDialogDefaults.adminAppBarTitle(widget.subCategory!)
          : Container();

  Widget _getContent(DetailedReading reading) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.start,
      mainAxisSize: MainAxisSize.max,
      children: [
        Flexible(
          child: NFMarquee(
            text: reading.name,
            style: GoogleFonts.italianno(
              color: Colors.black,
              fontSize: 45,
              fontWeight: FontWeight.bold,
            ),
          ),
        ),
        Flexible(
          child: RichText(
            text: TextSpan(
              children: [
                TextSpan(
                  text: "por",
                  style: GoogleFonts.italianno(
                    color: Colors.black87,
                    fontSize: 30,
                    fontWeight: FontWeight.normal,
                  ),
                ),
                TextSpan(
                  text: " some name",
                  style: GoogleFonts.italianno(
                    color: Colors.black,
                    fontSize: 30,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ],
            ),
            textAlign: TextAlign.right,
          ),
        ),
        const Divider(height: 20),
        QuillProvider(
          configurations: QuillConfigurations(
            controller: _getController(reading),
          ),
          child: Expanded(
            flex: 10,
            // child: QuillEditor.basic(
            //   configurations: const QuillEditorConfigurations(
            //     readOnly: true,
            //     enableInteractiveSelection: false,
            //   ),
            // ),
            child: QuillEditor.basic(
              configurations: const QuillEditorConfigurations(
                readOnly: true,
                showCursor: false,
                enableSelectionToolbar: false,
                scrollable: true,
                autoFocus: false,
              ),
            ),
          ),
        ),
      ],
    );
  }

  QuillController _getController(DetailedReading reading) {
    final controller = QuillController.basic();
    if (reading.format == "html") {
      controller.document = Document.fromDelta(
        HtmlToDeltaConverter.htmlToDelta(
          reading.text!,
        ),
      );
    } else {
      controller.document = Document.fromJson(
        jsonDecode(
          reading.text!,
        ),
      );
    }

    return controller;
  }
}

Screenshots or Video

Logs
Logs
[Paste your logs here]
@Salvador-dev Salvador-dev added the bug Something isn't working label Dec 5, 2023
@parseramuser4
Copy link

parseramuser4 commented Dec 6, 2023

Hello. This issue has been happening to me for a few days, and I've tried every method to solve it without success. In the simplest use case, using this editor on the web on iOS, this problem exists. As far as I understand, this occurs when tapping on any element of the editor, and typing also prevents the user from continuing to type. I created a blank page with the editor, and no specific settings have been applied. Please investigate and resolve this issue as soon as possible.

Flutter Quill version : 8.6.4
Flutter version : 3.16.2

Simulator Screen Shot - iPhone 13 Pro Max - 2023-12-06 at 09 30 32

import 'package:flutter/material.dart';
import 'package:flutter_quill/flutter_quill.dart';

class Test extends StatefulWidget {
  const Test({super.key});

  @override
  State<Test> createState() => _TestState();
}

class _TestState extends State<Test> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: QuillProvider(
      configurations: QuillConfigurations(
        controller: QuillController.basic(),
        sharedConfigurations: const QuillSharedConfigurations(),
      ),
      child: Column(
        children: [
          const QuillToolbar(),
          Expanded(
            child: QuillEditor.basic(
              configurations: QuillEditorConfigurations(
                readOnly: false,
              ),
            ),
          )
        ],
      ),
    ));
  }
}

@Salvador-dev
Copy link
Author

Salvador-dev commented Dec 6, 2023

Yeah this is the same problem we have, even on the latest versions of IOS

WhatsApp Image 2023-12-05 at 4 31 32 PM (1)
WhatsApp Image 2023-12-05 at 4 31 32 PM

@cgzdevelopments
Copy link

cgzdevelopments commented Dec 6, 2023

@Salvador-dev Hi! We have the same problem with our app. The Paste dialog does not allow the user to continue using the app and the editor is in "readonly" mode.

Flutter version
3.16.1

Flutter Quill version
8.6.4

@Joharte
Copy link

Joharte commented Dec 6, 2023

Good day, the same thing happens to me in my web application. In the case of android I see a dialog that wants to see the text and images that have been copied to the clipboard and in the case of IOS as soon as I touch the screen the paste button appears even when I am in read only (bad experience for the user who is only going to read and says Paste) I ask you please can help me with this

Flutter Quill version : 8.6.4
Flutter version : 3.16.1

@EchoEllet
Copy link
Collaborator

Hi, can you tell me how to encounter the issue in detail? I can't get it
Besides the toolbar in read-only mode usually hidden
image

@Salvador-dev
Copy link
Author

Hi, can you tell me how to encounter the issue in detail? I can't get it Besides the toolbar in read-only mode usually hidden image

You are using the same versions? (Flutter Quill version : 8.6.4, Flutter version : 3.16.1)

@cgzdevelopments
Copy link

@freshtechtips Hi, thanks for looking at this issue. I've noticed that it doesnt happen on simulator as i've tested on a IOS 15, 16 and 17 simulator and is working fine (no "Paste" dialog shows up). But i also tested on IOS 15, 16 and 17 real devices and "Paste" dialog shows up.

@EchoEllet
Copy link
Collaborator

@freshtechtips Hi, thanks for looking at this issue. I've noticed that it doesnt happen on simulator as i've tested on a IOS 15, 16 and 17 simulator and is working fine (no "Paste" dialog shows up). But i also tested on IOS 15, 16 and 17 real devices and "Paste" dialog shows up.

Thanks for the info

That's might be the problem

We are checking if the iOS is a simulator in some places

@Joharte
Copy link

Joharte commented Dec 9, 2023

Exactly in the simulator you don't see the "Paste" but on Apple devices it does appear and on Android devices it asks for permission only the first time you enter I was reading the documentation and I saw
RawEditorState extends EditorState please review and help me

@EchoEllet
Copy link
Collaborator

Exactly in the simulator you don't see the "Paste" but on Apple devices it does appear and on Android devices it asks for permission only the first time you enter I was reading the documentation and I saw
RawEditorState extends EditorState please review and help me

On Android, can you tell me which permissions it asks for?

@Joharte
Copy link

Joharte commented Dec 9, 2023

Android
issue

real devices read-only mode (in the text viewer) if you do not accept "paste" the data does not appear

issue ios apenas abro el visor

It seems that the editor will store the information on the clipboard, Only if I press the paste button does the text in the viewer appear

Thank you for your prompt response

@parseramuser4
Copy link

@singerdmx @freshtechtips
Hello. Has any action been taken on this issue? My application has become unusable for iOS users. This problem has been occurring for two weeks, and no action has been taken yet. Please prioritize addressing this issue. Many users are affected by this, but they may not have noticed it yet. Thank you for the time you spend on maintaining this practical extension.

@EchoEllet
Copy link
Collaborator

@singerdmx @freshtechtips
Hello. Has any action been taken on this issue? My application has become unusable for iOS users. This problem has been occurring for two weeks, and no action has been taken yet. Please prioritize addressing this issue. Many users are affected by this, but they may not have noticed it yet. Thank you for the time you spend on maintaining this practical extension.

Hi, I will try to reproduce it again and debug it today

@EchoEllet
Copy link
Collaborator

@singerdmx @freshtechtips Hello. Has any action been taken on this issue? My application has become unusable for iOS users. This problem has been occurring for two weeks, and no action has been taken yet. Please prioritize addressing this issue. Many users are affected by this, but they may not have noticed it yet. Thank you for the time you spend on maintaining this practical extension.

Still can't reproduce the issue

telegram-cloud-photo-size-2-5465388860059013600-y
telegram-cloud-photo-size-2-5465388860059013601-y
telegram-cloud-photo-size-2-5463014713806935419-y

@andrewmlevy
Copy link

andrewmlevy commented Dec 14, 2023

We are experiencing the same issue. Try running the project with a web target locally on your mac, once chrome launches open Safari and go to your localhost address with the project and you should be able to reproduce. The issue does not show up in Chrome.

@andrewmlevy
Copy link

@ellet0 or @singerdmx @freshtechtips were you able to reproduce? this is critical for us as well. It's fairly consistent if you run a web build and then point safari to your local server address.. Thanks!

@EchoEllet
Copy link
Collaborator

@ellet0 or @singerdmx @freshtechtips were you able to reproduce? this is critical for us as well. It's fairly consistent if you run a web build and then point safari to your local server address.. Thanks!

My apologies but until now I'm unable to reproduce the bug

@andrewmlevy
Copy link

Great news everyone @ellet0 @singerdmx I was able to recreate the issue

I ran this gist in Chrome and then loaded the localhost page in Safari (I haven't tested on iOS but I'm sure that will recreate it as well)
https://gist.github.com/andrewmlevy/527950deb95d3aedc0755bbf10f64019

The bug occurs when you hide the editor and then show it again. Click Hide Quill then Show Quill to recreate:
image
image
image

The workaround is to use the Offstage widget:
Offstage(offstage: !showQuill, child: buildEditor()), !showQuill ? Text("No Quill") : Container(),

However we would still love for the bug to be addressed; this would mean rendering a lot of content to get around it. Thanks!

@EchoEllet EchoEllet pinned this issue Dec 21, 2023
@EchoEllet
Copy link
Collaborator

EchoEllet commented Dec 21, 2023

Great news everyone @ellet0 @singerdmx I was able to recreate the issue

I ran this gist in Chrome and then loaded the localhost page in Safari (I haven't tested on iOS but I'm sure that will recreate it as well) https://gist.github.com/andrewmlevy/527950deb95d3aedc0755bbf10f64019

The bug occurs when you hide the editor and then show it again. Click Hide Quill then Show Quill to recreate: image image image

The workaround is to use the Offstage widget: Offstage(offstage: !showQuill, child: buildEditor()), !showQuill ? Text("No Quill") : Container(),

However we would still love for the bug to be addressed; this would mean rendering a lot of content to get around it. Thanks!

My apologies, does the bug happened on all platforms or just iOS on web browser?

image

@andrewmlevy
Copy link

My apologies, does the bug happened on all platforms or just iOS on web browser?

Correct. I have tested on Android and MacOS, the issue is not there. It is just iOS and web browser (safari).

Repository owner deleted a comment from singerdmx Dec 28, 2023
@EchoEllet
Copy link
Collaborator

Can't test iOS apps on real iPhone for now but I will try

@mtallenca
Copy link
Contributor

mtallenca commented Dec 28, 2023

I am seeing this with Safari web on desktop. Beginning with the latest release of Safari 17.2.1 that comes with MacOS 14.2.1. I'm using flutter quill 9.1.1 - I see the same paste menu issue with 8.6.4

@Mmisiek
Copy link
Contributor

Mmisiek commented Dec 30, 2023

I see this error on Safari on a Mac desktop, too. Safari version 16.5.2 no issues with Chrome on same Mac.

@Mmisiek
Copy link
Contributor

Mmisiek commented Dec 30, 2023

Great news everyone @ellet0 @singerdmx I was able to recreate the issue

I ran this gist in Chrome and then loaded the localhost page in Safari (I haven't tested on iOS but I'm sure that will recreate it as well) https://gist.github.com/andrewmlevy/527950deb95d3aedc0755bbf10f64019

The bug occurs when you hide the editor and then show it again. Click Hide Quill then Show Quill to recreate: image image image

The workaround is to use the Offstage widget: Offstage(offstage: !showQuill, child: buildEditor()), !showQuill ? Text("No Quill") : Container(),

However we would still love for the bug to be addressed; this would mean rendering a lot of content to get around it. Thanks!

I tried this solution but does not work, when Editor is visible it still is stuck in Safari ;(

@EchoEllet
Copy link
Collaborator

I see this error on Safari on a Mac desktop, too. Safari version 16.5.2 no issues with Chrome on same Mac.

I can test it on real iOS now, but I need detailed steps to reproduce the bug because I still can't reproduce
Last time I tried

@Mmisiek
Copy link
Contributor

Mmisiek commented Jan 4, 2024

I see this error on Safari on a Mac desktop, too. Safari version 16.5.2 no issues with Chrome on same Mac.

I can test it on real iOS now, but I need detailed steps to reproduce the bug because I still can't reproduce Last time I tried

How about this example ? https://gist.github.com/andrewmlevy/527950deb95d3aedc0755bbf10f64019

@JoepHeijnen
Copy link
Contributor

Is there any progress on this issue? This is quite blocking for our web app.

@Albert-Jan
Copy link

I'm still facing the same issue as above, even on Safari on a MacBook. Would love to help in any way :)

@andrewmlevy
Copy link

Same, this is still causing issues for us

@Martin-QPT
Copy link

Same - luckily my client primarily uses Edge per company policy but any Safari users are seeing this including myself on a physical MacBook.

@EchoEllet
Copy link
Collaborator

Hi, let me know if you still facing the issue, it has been fixed by @mtallenca

If no one is facing the issue then we should get ready to close the issue

@andrewmlevy
Copy link

It looks to be fixed, thanks!!!

@Mmisiek
Copy link
Contributor

Mmisiek commented Feb 17, 2024

Yea ! fixed, thanks !

@EchoEllet EchoEllet unpinned this issue Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet