Class JsEvent
Subscribe JS events of any element by html id
public class JsEvent : IJsEvent, IDisposable
- Inheritance
-
JsEvent
- Implements
- Inherited Members
- Extension Methods
Constructors
JsEvent(IJSRuntime)
public JsEvent(IJSRuntime jsRuntime)
Parameters
jsRuntime
IJSRuntime
Methods
Connect(string, JsEventOptions)
Connect to the ancestor element of the element(s) that should be observed
public Task Connect(string elementId, JsEventOptions options)
Parameters
elementId
stringAncestor html element id
options
JsEventOptionsDefine here the descendant(s) by setting TargetClass and the keystrokes to be monitored
Returns
Disconnect()
Disconnect from the previously connected ancestor and its descendants
public Task Disconnect()
Returns
Dispose()
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
OnCaretPositionChanged(int)
To be invoked only by JS
[JSInvokable]
public void OnCaretPositionChanged(int caretPosition)
Parameters
caretPosition
int
OnPaste(string)
To be invoked only by JS
[JSInvokable]
public void OnPaste(string text)
Parameters
text
string
OnSelect(int, int)
To be invoked only by JS
[JSInvokable]
public void OnSelect(int start, int end)
Parameters
Events
CaretPositionChanged
Subscribe this event to get notified about caret changes in an input on click and on keyup
public event Action<int> CaretPositionChanged
Event Type
Paste
Subscribe this event to get notified about paste actions
public event Action<string> Paste
Event Type
Select
Subscribe this event to get notified about paste actions
public event Action<int, int> Select