[Mobile] customRecognizerBuilder not triggered for links in bullet list
Is there an existing issue for this?
- [X] I have searched the existing issues
Flutter Quill version
9.4.2
Steps to reproduce
Add customRecognizerBuilder to the QuillEditor:
customRecognizerBuilder: (Attribute attribute, Leaf leaf) {
// We are not using default long press context menu for handling the links
return TapGestureRecognizer()
..onTap = () {
if (attribute.key == Attribute.link.key) {
launchUrlFromQuill(context, attribute.value.toString());
}
};
},
This is text used to test:
[
{
"insert": "Google",
"attributes": {
"link": "https://www.google.com/"
}
},
{
"insert": "\n",
"attributes": {
"list": "bullet"
}
},
{
"insert": "\n\nAnd this link works: "
},
{
"insert": "Google",
"attributes": {
"link": "https://www.google.com/"
}
}
]
Expected results
Every link should trigger TapGestureRecognizer defined in customRecognizerBuilder. In bullets it does't trigger it - only long press works in that case.
Actual results
TapGestureRecognizer defined as customRecognizerBuilder is not being triggered when it is in bullet list - in that case only long press on link works.
Code sample
Code sample
QuillEditor(
focusNode: FocusNode(canRequestFocus: false),
scrollController: ScrollController(),
configurations: QuillEditorConfigurations(
controller: _quillController,
scrollable: true,
padding: EdgeInsets.zero,
autoFocus: false,
checkBoxReadOnly: true,
showCursor: false,
expands: false,
customRecognizerBuilder: (Attribute attribute, Leaf leaf) {
// We are not using default long press context menu for handling the links
return TapGestureRecognizer()
..onTap = () {
if (attribute.key == Attribute.link.key) {
launchUrlFromQuill(context, attribute.value.toString());
}
};
},
onLaunchUrl: (link) => launchUrlFromQuill(context, link),
),
),
Screenshots or Video
No response
Logs
No response
Can you provide what launchUrlFromQuill() does?
It opens url in external app with url_launcher:
launcher.launchUrl(
Uri.parse(url),
mode: launcher.LaunchMode.externalApplication,
);
Does this issue still persists? If does, please reopen this. I think this was fixed on some of the lastest versions (i could be wrong).
@tsafundzic Can you confirm if this still an issue?
I think this was fixed since EditableTextBlock needs customRecognizerBuilder at pass this into TextLine. So, probably was an issue from the version.