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

[IOS] Paste from Note App not work for version 9.x.x (super_clipboard plugin) #1627

Closed
1 task done
NhaPCS opened this issue Dec 20, 2023 · 33 comments
Closed
1 task done
Labels
bug Something isn't working

Comments

@NhaPCS
Copy link

NhaPCS commented Dec 20, 2023

Is there an existing issue for this?

Flutter Quill version

9.0.5

Other Flutter Quill packages versions

flutter_quill: ^9.0.5
flutter_quill_extensions: ^9.0.5

Steps to reproduce

  1. Open IOS Note app (that comes with the system)
  2. Copy some text from any Note
  3. Open Quill Flutter example app => Paste the copied text

Expected results

It should be paste the text as normal

Actual results

e7d3f57e0e54a60aff45
The result after paste is containing the text styles like this

Code sample

Code sample
return Container(
      decoration: BoxDecoration(
          color: ColorUtils.grey300, borderRadius: DimensionUtil.smallRadius),
      padding: const EdgeInsets.all(12),
      child: QuillEditor(
        focusNode: focusNode ?? FocusNode(),
        scrollController: scrollController,
        configurations: QuillEditorConfigurations(
          contextMenuBuilder: selectionToolbars != null
              ? (context, state) {
                  return TextFieldTapRegion(
                    child: AdaptiveTextSelectionToolbar(
                      anchors: state.contextMenuAnchors,
                      children: selectionToolbars,
                    ),
                  );
                }
              : null,
          scrollable: true,
          autoFocus: false,
          readOnly: readOnly,
          placeholder: placeholder,
          customStyles: DefaultStyles(
            paragraph: DefaultTextBlockStyle(
              TextStyles.textBiggerNarrowStyle
                  .copyWith(fontFamily: TextStyles.fontDefault),
              const VerticalSpacing(0, 0),
              const VerticalSpacing(0, 0),
              null,
            ),
            placeHolder: DefaultListBlockStyle(
                TextStyles.level2BiggerNarrowStyle
                    .copyWith(fontFamily: TextStyles.fontDefault),
                const VerticalSpacing(0, 0),
                const VerticalSpacing(0, 0),
                null,
                null),
          ),
          expands: true,
          padding: EdgeInsets.only(bottom: 50),
          keyboardAppearance: Brightness.light,
          embedBuilders: FlutterQuillEmbeds.editorBuilders(),
          controller: quillController,
        ),
      ),
    );

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]
@NhaPCS NhaPCS added the bug Something isn't working label Dec 20, 2023
@EchoEllet
Copy link
Collaborator

Is the issue specific to 9.0.5? because we didn't change anything in QuillRawEditorState or copy/paste texts in this update

@NhaPCS
Copy link
Author

NhaPCS commented Dec 20, 2023

Is the issue specific to 9.0.5? because we didn't change anything in QuillRawEditorState or copy/paste texts in this update

I think the issue is for 9.x.x when you Replace pasteboard with rich_cliboard

@EchoEllet EchoEllet changed the title [IOS] Paste from Note App not work for version 9.0.5 [IOS] Paste from Note App not work for version 9.x.x (rich_cliboard plugin) Dec 20, 2023
@EchoEllet
Copy link
Collaborator

I can try to fix it but I need ask some questions @singerdmx

@EchoEllet
Copy link
Collaborator

Are you pasting text using the context menu or something else?

image

@NhaPCS
Copy link
Author

NhaPCS commented Dec 21, 2023

@ellet0 please test it will IOS Notes app, I found the issue when I copy text from Notes to quill editor version 9.0.5

@NhaPCS
Copy link
Author

NhaPCS commented Dec 21, 2023

@ellet0 and one more issue, after pasting a text, it always inserts the new line at first. Please refer to below video

04b833d620074c9bafa23d0e670f5ca1.mp4

@EchoEllet
Copy link
Collaborator

EchoEllet commented Dec 21, 2023

@ellet0 and one more issue, after pasting a text, it always inserts the new line at first. Please refer to below video

04b833d620074c9bafa23d0e670f5ca1.mp4

That's known issue and we are woking on it, it happen only when copying styled text
let's focus on the one from the title.

@NhaPCS
Copy link
Author

NhaPCS commented Dec 21, 2023

plz fix it, thanks! @ellet0

@EchoEllet
Copy link
Collaborator

plz fix it, thanks! @ellet0

I just need a few questions from the old maintainers because they have ore experience with the repo than me, and then I will fix it correctly!

@EchoEllet
Copy link
Collaborator

@ellet0 and one more issue, after pasting a text, it always inserts the new line at first. Please refer to below video

This particular bug has been fixed in 9.1.1

@EchoEllet
Copy link
Collaborator

I still can't reproduce the original bug in the title

@NhaPCS
Copy link
Author

NhaPCS commented Dec 22, 2023

@ellet0 I tested with version 9.1.0, and that bug is fixed. Thank you so much!

@EchoEllet
Copy link
Collaborator

@ellet0 I tested with version 9.1.0, and that bug is fixed. Thank you so much!

Hi, which bug exactly has been fixed? Or both?

@NhaPCS
Copy link
Author

NhaPCS commented Dec 22, 2023

@ellet0 I tested with version 9.1.0, and that bug is fixed. Thank you so much!

Hi, which bug exactly has been fixed? Or both?

Both, the copy from Notes app bug and auto added new line at first also.

@EchoEllet
Copy link
Collaborator

@ellet0 I tested with version 9.1.0, and that bug is fixed. Thank you so much!

Hi, which bug exactly has been fixed? Or both?

Both, the copy from Notes app bug and auto added new line at first also.

Glad to hear that. If you have any questions, feel free to ask at any time!

@NhaPCS
Copy link
Author

NhaPCS commented Dec 24, 2023

@ellet0 Hi, I think the issues are still there, I just tried again with example of version 9.1.0. Please check the following video, it includes 2 issues: new line at first and copy from Note app

4026628878281770902.mp4

@EchoEllet
Copy link
Collaborator

@ellet0 Hi, I think the issues are still there, I just tried again with example of version 9.1.0. Please check the following video, it includes 2 issues: new line at first and copy from Note app

4026628878281770902.mp4

Hi. We haven't published the fix yet. Please try the example and fetch the latest changes

@NhaPCS
Copy link
Author

NhaPCS commented Dec 24, 2023

@ellet0 I tried the example on master branch

@EchoEllet EchoEllet reopened this Dec 24, 2023
@EchoEllet
Copy link
Collaborator

EchoEllet commented Dec 24, 2023

@ellet0 I tried the example on master branch

The issue of the new line should be fixed in the master branch

@NhaPCS
Copy link
Author

NhaPCS commented Jan 2, 2024

@ellet0 any update?

@EchoEllet
Copy link
Collaborator

@ellet0 any update?

The second issue should be fixed. The first issue still can't reproduce it

@Mmisiek
Copy link
Contributor

Mmisiek commented Jan 2, 2024

I still see this issue with 9.2.1 in my app. In the Notes App on iPad, I have a note with increased title font, etc. I "Select All" and "Copy," then I go to Quill Editor, open and Paste from the iOS context menu when I press and hold. In such cases, I see metadata about the fonts used in Notes, and text is copied without formatting.
image

image

@EchoEllet
Copy link
Collaborator

EchoEllet commented Jan 2, 2024

Unfortunately, I can't debug on real iOS for now, I can reproduce the bug only on simulator which doesn't have Apple notes app

@Mmisiek
Copy link
Contributor

Mmisiek commented Jan 2, 2024

Collaborator

How can I help? I have real devices (phones, iPads, Macs).

@EchoEllet
Copy link
Collaborator

Collaborator

How can I help? I have real devices (phones, iPads, Macs).

In your app, add this plugin

Setup it only for iOS for now, try to get the clipboard and get the contents as HTML if it can provide it, see how does the HTML looks like and send me the output

@Mmisiek
Copy link
Contributor

Mmisiek commented Jan 2, 2024

Collaborator

How can I help? I have real devices (phones, iPads, Macs).

In your app, add this plugin

Setup it only for iOS for now, try to get the clipboard and get the contents as HTML if it can provide it, see how does the HTML looks like and send me the output

OK, let me try.

@EchoEllet
Copy link
Collaborator

EchoEllet commented Jan 2, 2024

  import 'package:super_clipboard/super_clipboard.dart';

    // ...

    final clipboard = SystemClipboard.instance;
    if (clipboard == null) {
        return; // Clipboard API is not supported on this platform.
    }
    final reader = await clipboard.read();

    if (reader.canProvide(Formats.htmlText)) {
        final html = await reader.readValue(Formats.htmlText);
        print(html);
    }

@EchoEllet
Copy link
Collaborator

I just found an old iPhone, I will test it but I can't using the example, so I will have to on a real project that have signing setup properly

@Mmisiek
Copy link
Contributor

Mmisiek commented Jan 2, 2024

I just found an old iPhone, I will test it but I can't using the example, so I will have to on a real project that have signing setup properly

I will be able to check this in the evening, if you will not have solution before then I will provide HTML clipboard content.

@EchoEllet EchoEllet changed the title [IOS] Paste from Note App not work for version 9.x.x (rich_cliboard plugin) [IOS] Paste from Note App not work for version 9.x.x (rich_clipboard plugin) Jan 2, 2024
@EchoEllet EchoEllet changed the title [IOS] Paste from Note App not work for version 9.x.x (rich_clipboard plugin) [IOS] Paste from Note App not work for version 9.x.x (super_clipboard plugin) Jan 2, 2024
EchoEllet pushed a commit that referenced this issue Jan 2, 2024
@EchoEllet
Copy link
Collaborator

You can try now 9.2.2 and see if it fix the bug, in my case it did

@Mmisiek
Copy link
Contributor

Mmisiek commented Jan 3, 2024

Hi I just tested on iPad and looks ok too. I am not sure if there is no extra lines on top of text but for sure formating is removed. Thank you !

@Mmisiek
Copy link
Contributor

Mmisiek commented Jan 3, 2024

I think this can be closed.

@EchoEllet
Copy link
Collaborator

Thank you

You're welcome.

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
Development

No branches or pull requests

3 participants