mirror of
https://github.com/MontFerret/ferret.git
synced 2025-01-28 03:56:45 +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('input', { 'bubbles': true, cancelable: true }));
|
||||||
element.dispatchEvent(new Event('change', { 'bubbles': true }));
|
element.dispatchEvent(new Event('change', { 'bubbles': true, cancelable: true }));
|
||||||
|
|
||||||
return options.filter(option => option.selected).map(option => option.value);
|
return options.filter(option => option.selected).map(option => option.value);
|
||||||
`,
|
`,
|
||||||
|
@ -16,7 +16,7 @@ func DispatchEvent(
|
|||||||
eventName string,
|
eventName string,
|
||||||
) (values.Boolean, error) {
|
) (values.Boolean, error) {
|
||||||
evt, err := client.Runtime.Evaluate(ctx, runtime.NewEvaluateArgs(eval.PrepareEval(fmt.Sprintf(`
|
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))))
|
`, eventName))))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user