Class ClickTrigger
java.lang.Object
com.vaadin.flow.component.trigger.internal.Trigger
com.vaadin.flow.component.trigger.internal.DomEventTrigger
com.vaadin.flow.component.trigger.internal.ClickTrigger
- All Implemented Interfaces:
Serializable
Fires on the host component's
click DOM event and exposes the click
coordinates and modifier-key state as Action.Inputs for downstream
actions.
Example:
ClickTrigger click = new ClickTrigger(button);
click.triggers(new SetPropertyAction<>(xField, "value", click.screenX()),
new SetPropertyAction<>(yField, "value", click.screenY()));
For internal use only. May be renamed or removed in a future release.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionClickTrigger(Component host) Creates a click trigger on the given host component's root element. -
Method Summary
Modifier and TypeMethodDescriptionaltKey()event.altKey— whether alt was held during the click.clientX()event.clientX— X coordinate relative to the viewport.clientY()event.clientY— Y coordinate relative to the viewport.ctrlKey()event.ctrlKey— whether ctrl was held during the click.metaKey()event.metaKey— whether meta was held during the click.screenX()event.screenX— X coordinate relative to the screen.screenY()event.screenY— Y coordinate relative to the screen.shiftKey()event.shiftKey— whether shift was held during the click.Methods inherited from class com.vaadin.flow.component.trigger.internal.DomEventTrigger
installJs, property
-
Constructor Details
-
ClickTrigger
Creates a click trigger on the given host component's root element.- Parameters:
host- the component to listen on, notnull
-
-
Method Details
-
screenX
event.screenX— X coordinate relative to the screen. -
screenY
event.screenY— Y coordinate relative to the screen. -
clientX
event.clientX— X coordinate relative to the viewport. -
clientY
event.clientY— Y coordinate relative to the viewport. -
shiftKey
event.shiftKey— whether shift was held during the click. -
ctrlKey
event.ctrlKey— whether ctrl was held during the click. -
altKey
event.altKey— whether alt was held during the click. -
metaKey
event.metaKey— whether meta was held during the click.
-