mirror of
https://github.com/MontFerret/ferret.git
synced 2025-01-18 03:22:02 +02:00
Updated JS event dispatching
This commit is contained in:
parent
61933caec9
commit
fdf3c7c33f
@ -509,8 +509,8 @@ func (doc *HTMLDocument) SelectBySelector(selector values.String, value *values.
|
||||
}
|
||||
}
|
||||
|
||||
element.dispatchEvent(new Event('input', { 'bubbles': true }));
|
||||
element.dispatchEvent(new Event('change', { 'bubbles': true }));
|
||||
element.dispatchEvent(new Event('input', { 'bubbles': true, cancelable: true }));
|
||||
element.dispatchEvent(new Event('change', { 'bubbles': true, cancelable: true }));
|
||||
|
||||
return options.filter(option => option.selected).map(option => option.value);
|
||||
`,
|
||||
|
@ -16,7 +16,7 @@ func DispatchEvent(
|
||||
eventName string,
|
||||
) (values.Boolean, error) {
|
||||
evt, err := client.Runtime.Evaluate(ctx, runtime.NewEvaluateArgs(eval.PrepareEval(fmt.Sprintf(`
|
||||
return new window.MouseEvent('%s', { bubbles: true })
|
||||
return new window.MouseEvent('%s', { bubbles: true, cancelable: true })
|
||||
`, eventName))))
|
||||
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user