Merge pull request #2803 from Zarthus/on-link-clicked

Expand docs for on_link_click in Rich Text
This commit is contained in:
Héctor 2025-11-21 00:42:50 +01:00 committed by GitHub
commit 4406681221
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -133,11 +133,15 @@ where
/// Sets the message that will be produced when a link of the [`Rich`] text
/// is clicked.
///
/// If the spans of the [`Rich`] text contain no links, you may need to call
/// this method with `on_link_click(never)` in order for the compiler to infer
/// the proper `Link` generic type.
pub fn on_link_click(
mut self,
on_link_clicked: impl Fn(Link) -> Message + 'a,
on_link_click: impl Fn(Link) -> Message + 'a,
) -> Self {
self.on_link_click = Some(Box::new(on_link_clicked));
self.on_link_click = Some(Box::new(on_link_click));
self
}