You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[url_launcher] [Web] Clicking on Link without calling followLink function still takes user to that link. #162927
If you wrap a ElevatedButton with Link widget on web, and don't pass followLink function to ElevatedButton, when you click on that ElevatedButton button, it still takes user to that link.
Expected results
It should only take user to that link when followLink function is called
Actual results
Even i am not passing followLink function to ElevatedButton's onPressed property but Its still opening link that i set in uri of Link widget.
Doctor summary (to see all details, run flutter doctor -v):[✓] Flutter (Channel stable, 3.27.4, on macOS 15.2 24C101 darwin-arm64, locale en-PK)[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)[✓] Xcode - develop for iOS and macOS (Xcode 16.1)[✓] Chrome - develop for the web[✓] Android Studio (version 2023.3)[✓] Connected device (4 available)[✓] Network resources
Could you describe the use case for this code? What is the effect you are trying to achieve by using Link but not using followLink as the documentation says to do?
I have custom implementation, when elevated button is clicked, i update my state, and then that state updates route.
And i use Link because user can right click on my elevated button and open that link in new tab.
The difference I observed if we pass followLink to onPressed is that the button gets activated upon cursor or mouse hover over the button. If we pass null to it, the hover effect doesn't take place while the button is tappable and opens the link.
Will keep the issue open for the use case described.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
stuartmorgan-g commentedon Feb 8, 2025
Could you describe the use case for this code? What is the effect you are trying to achieve by using
Linkbut not usingfollowLinkas the documentation says to do?aarajput commentedon Feb 8, 2025
I have custom implementation, when elevated button is clicked, i update my state, and then that state updates route.
And i use
Linkbecause user can right click on my elevated button and open that link in new tab.aarajput commentedon Feb 9, 2025
darshankawar commentedon Feb 10, 2025
The difference I observed if we pass
followLinktoonPressedis that the button gets activated upon cursor or mouse hover over the button. If we passnullto it, the hover effect doesn't take place while the button is tappable and opens the link.Will keep the issue open for the use case described.
[url_launcher][web] Prevent browser from navigating when followLink i…
github-actions commentedon Mar 13, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.[url_launcher][web] Prevent browser from navigating when followLink i…
[url_launcher][web] Prevent browser from navigating when followLink i…
[url_launcher][web] Prevent browser from navigating when followLink i…
[url_launcher][web] Prevent browser from navigating when followLink i…