-
Notifications
You must be signed in to change notification settings - Fork 550
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
Hyperlink cannot be triggered in non edit state. #41
Comments
Thanks for submitting this issue! This is definitely something I'll be looking to fix. |
Is this fixed? |
I’m planning to address this in the next couple of weeks, so stay tuned! |
Any updates on this?? |
I'll have a look next week. I also have the issue. |
a solution here: #211 :) |
You can listen to controller and then get the style attribute of the clicked element if thats notusattribte.Link. you got the url just open it with url_launcher |
You can use TextSelectionGestureDetector but there is a better way to handle ur need. Check my above comment |
Can you please write some code to explain this a bit? How can I get the text on which the user tapped for checking if it is a link? I'm a little new to Flutter, so it'd be great if you could help. |
This is probably not relevant to you guys anymore, but the links still didn't work for me in a non-edit state, so I found this solution based on raj457036 comment: First, add a listener to the controller via controller.addListener(handleLinkClicked);
|
first of all, apologies I was very busy with work @Jackilion your solution might also work well. So here is what I used in my project ...
// define controller and listen to controller
_controller = ZefyrController(
NotusDocument.fromDelta(delta)
)..addListener(linkListener);
...
linkListener() {
// check if any link is clicked
final _url = _controller.getSelectionStyle().get(NotusAttribute.link)?.value;
// if url found launch it
if (_url != null) {
launchURL(_url);
}
} |
1、Hyperlink cannot be triggered in non edit state.
2、EditableBox will terminate the GestureDetector event of custom widgets.
The text was updated successfully, but these errors were encountered: