diff --git a/articles/flow/browser-apis/clipboard-api.adoc b/articles/flow/browser-apis/clipboard-api.adoc index 446377c318..398e352d99 100644 --- a/articles/flow/browser-apis/clipboard-api.adoc +++ b/articles/flow/browser-apis/clipboard-api.adoc @@ -70,7 +70,7 @@ Any component implementing [interfacename]`HasValue` works -- [classn == Other Click Sources -[methodname]`Clipboard.onClick()` accepts any component implementing [interfacename]`ClickNotifier`, not just [classname]`Button`. A [classname]`ContextMenu` item is a common alternative -- the user right-clicks a target and picks "Copy" from the menu: +[methodname]`Clipboard.onClick()` accepts any component, not just [classname]`Button`. A [classname]`ContextMenu` item is a common alternative -- the user right-clicks a target and picks "Copy" from the menu: [source,java] ---- diff --git a/articles/flow/browser-apis/web-share-api.adoc b/articles/flow/browser-apis/web-share-api.adoc index b2cf90ccde..5a46e7c636 100644 --- a/articles/flow/browser-apis/web-share-api.adoc +++ b/articles/flow/browser-apis/web-share-api.adoc @@ -29,7 +29,7 @@ WebShare.onClick(shareButton).share( ShareContent.create().title("Vaadin").url("https://vaadin.com")); ---- -The trigger component must implement [interfacename]`ClickNotifier`, which covers buttons and most other clickable components. +The trigger can be any component whose root element receives the click -- not only components that implement [interfacename]`ClickNotifier`, but also, for example, menu items. [IMPORTANT] [methodname]`onClick(...)` _arms_ the share action; it does not register a click listener you fill in later. The share sheet must open inside the browser's gesture window, so the action has to be armed up front -- calling [methodname]`share()` from an [methodname]`addClickListener` callback runs one round-trip too late and the browser rejects it. Forgetting [methodname]`share()` altogether -- a binding created with no action -- fails loudly instead: the framework throws an [classname]`IllegalStateException` when the view renders. See <<{articles}/flow/browser-apis/clipboard-api#how-the-binding-works,How the Click Binding Works>> in the Clipboard article for the full explanation of this arm-don't-handle model.