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

Copy text to clipboard with style #305

Open
Faiyyaz opened this issue May 18, 2020 · 3 comments
Open

Copy text to clipboard with style #305

Faiyyaz opened this issue May 18, 2020 · 3 comments

Comments

@Faiyyaz
Copy link

Faiyyaz commented May 18, 2020

Steps to Reproduce

  1. Just write some text with style like bold, italic etc
  2. Copy it to clipboard
  3. Remove all and text and try pasting the text
  4. All the text gets copied perfectly but the styling is not there anymore
[✓] Flutter (Channel stable, v1.17.1, on Mac OS X 10.15.4 19E287, locale en-GB)
    • Flutter version 1.17.1 at /users/faiyyazkhatri/StudioProjects/flutter
    • Framework revision f7a6a7906b (5 days ago), 2020-05-12 18:39:00 -0700
    • Engine revision 6bc433c6b6
    • Dart version 2.8.2

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /users/faiyyazkhatri/Library/Android/sdk
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /users/faiyyazkhatri/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.4.1, Build version 11E503a
    • CocoaPods version 1.9.1

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.8052
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] Connected device (1 available)
    • iPhone SE (2nd generation) • AAFB81DE-7D22-48A8-9D3C-1C30D3F0D192 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-4 (simulator)

• No issues found!
@nipunasudha
Copy link

It would be amazing if we can fix this. I'll mention this issue in the 1.0 milestone issue.

@cgestes
Copy link
Collaborator

cgestes commented Oct 19, 2021

May be blocked by flutter/flutter#23603

@nipunasudha do you have an idea of how to implement what you suggest?

@nipunasudha
Copy link

May be blocked by flutter/flutter#23603

@nipunasudha do you have an idea of how to implement what you suggest?

I'm not familiar with how the package currently handles it. But I think keeping two clipboards would solve this.

  • First one is the system clipboard which only keeps the plain text version.
  • The secondary one in the memory, keeping both plain & rich versions.

Then when a user paste the text back to the editor, we can check if the system clipboard matches the cached plain version. This is to make sure what the user is trying to paste is the same thing he copied. If so, we can insert the respective styled version into the document 😄

Just an idea but I think it'll be a good solution until flutter fixes that issue.

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

No branches or pull requests

3 participants