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

Selectable text cannot copy #125

Open
Juggler98 opened this issue Oct 10, 2023 · 6 comments
Open

Selectable text cannot copy #125

Juggler98 opened this issue Oct 10, 2023 · 6 comments

Comments

@Juggler98
Copy link

When select text, it doesn't provide copy button like in the previous version. Is it just me getting this issue?

@aabughazaleh
Copy link

same here

@Thoxh
Copy link

Thoxh commented Oct 24, 2023

Same here on iOS 17.0 for iPhone debugging on physical device.

@zhenorzz
Copy link

find a solution to show copy & select all.

SelectableLinkify(
                        contextMenuBuilder: (context, editableTextState) {
                          return AdaptiveTextSelectionToolbar.buttonItems(
                            anchors: editableTextState.contextMenuAnchors,
                            buttonItems: <ContextMenuButtonItem>[
                              ContextMenuButtonItem(
                                onPressed: () {
                                  editableTextState.copySelection(
                                      SelectionChangedCause.toolbar);
                                },
                                type: ContextMenuButtonType.copy,
                              ),
                              ContextMenuButtonItem(
                                onPressed: () {
                                  editableTextState.selectAll(
                                      SelectionChangedCause.toolbar);
                                },
                                type: ContextMenuButtonType.selectAll,
                              ),
                            ],
                          );
                        },
                        text: utf8.decode(bytes),
)

@rt234cw
Copy link

rt234cw commented Dec 3, 2023

find a solution to show copy & select all.

SelectableLinkify(
                        contextMenuBuilder: (context, editableTextState) {
                          return AdaptiveTextSelectionToolbar.buttonItems(
                            anchors: editableTextState.contextMenuAnchors,
                            buttonItems: <ContextMenuButtonItem>[
                              ContextMenuButtonItem(
                                onPressed: () {
                                  editableTextState.copySelection(
                                      SelectionChangedCause.toolbar);
                                },
                                type: ContextMenuButtonType.copy,
                              ),
                              ContextMenuButtonItem(
                                onPressed: () {
                                  editableTextState.selectAll(
                                      SelectionChangedCause.toolbar);
                                },
                                type: ContextMenuButtonType.selectAll,
                              ),
                            ],
                          );
                        },
                        text: utf8.decode(bytes),
)

it works! thanks!!

for those who doesn't know how to use text: utf8.decode(bytes)

text:utf8.decode(uft8.encode('your text.....'))

@Kinwailo
Copy link

use this for contextMenuBuilder is enough:

contextMenuBuilder: (_, state) =>
  AdaptiveTextSelectionToolbar.buttonItems(
    anchors: state.contextMenuAnchors,
    buttonItems: state.contextMenuButtonItems),

@swayamshreemohanty
Copy link

swayamshreemohanty commented Apr 16, 2024

find a solution to show copy & select all.

SelectableLinkify(
                        contextMenuBuilder: (context, editableTextState) {
                          return AdaptiveTextSelectionToolbar.buttonItems(
                            anchors: editableTextState.contextMenuAnchors,
                            buttonItems: <ContextMenuButtonItem>[
                              ContextMenuButtonItem(
                                onPressed: () {
                                  editableTextState.copySelection(
                                      SelectionChangedCause.toolbar);
                                },
                                type: ContextMenuButtonType.copy,
                              ),
                              ContextMenuButtonItem(
                                onPressed: () {
                                  editableTextState.selectAll(
                                      SelectionChangedCause.toolbar);
                                },
                                type: ContextMenuButtonType.selectAll,
                              ),
                            ],
                          );
                        },
                        text: utf8.decode(bytes),
)

This is worked for me, thanks

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

7 participants