flutter-quill
flutter-quill copied to clipboard
[Mobile] Paste Behavior
The behavior when pasting text on iOS is different from native apps such as the notes app that comes with the phone. I'm used to tapping anywhere in a text on iOS, and then the context menu appears immediately. However, with this library, I have to hold for like a second and then let go for the menu to appear. That feels unnatural.
I also tested with the latest version of the example app (on an iPhone 12 Pro), and it is the same behavior there.
This seems OS behavior IIRC. Not something the app controls. But I am not 100% confident.
@singerdmx thanks but this works perfectly fine in other iOS apps.
In the code we are using toolbarOptions Not sure if it is possible to configure the behavior there

I think I found where it is shouldShowSelectionToolbar
We investigated it and right now we are assuming showing toolbar (a.k.a context menu) only when !textEditingValue.selection.isCollapsed. See
void _updateOrDisposeSelectionOverlayIfNeeded() {
if (_selectionOverlay != null) {
if (_hasFocus && !textEditingValue.selection.isCollapsed) {
_selectionOverlay!.update(textEditingValue);
} else {
_selectionOverlay!.dispose();
_selectionOverlay = null;
}
} else if (_hasFocus) {
_selectionOverlay?.hide();
_selectionOverlay = null;
if (widget.selectionControls != null) {
_selectionOverlay = EditorTextSelectionOverlay(
clipboardStatus: _clipboardStatus,
context: context,
value: textEditingValue,
debugRequiredFor: widget,
toolbarLayerLink: _toolbarLayerLink,
startHandleLayerLink: _startHandleLayerLink,
endHandleLayerLink: _endHandleLayerLink,
renderObject: renderEditor,
selectionControls: widget.selectionControls,
selectionDelegate: this,
dragStartBehavior: DragStartBehavior.start,
// onSelectionHandleTapped: widget.onSelectionHandleTapped,
);
_selectionOverlay!.handlesVisible = _shouldShowSelectionHandles();
_selectionOverlay!.showHandles();
// if (widget.onSelectionChanged != null)
// widget.onSelectionChanged(selection, cause);
}
}
}
Changing this behavior for onTapDown in delegate.dart or onSingleTapUp in editor.dart introduces a lot of issues. Probably can revisit this in the future.
@override
void onSingleTapUp(TapUpDetails details) {
if (_state.widget.onTapUp != null) {
final renderEditor = getRenderEditor();
if (renderEditor != null) {
if (_state.widget.onTapUp!(
details, renderEditor.getPositionForOffset)) {
return;
}
}
}
**getEditor()!.hideToolbar();**
Thank you for the report, this issue has been open for a while and since there are no interactions with it, we had to close it
but if you still facing this issue, or other issues or you have any other questions, feel free to contact us anytime you want.