1
0
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:
Tim Voronov 2019-01-21 13:58:37 -05:00
parent 61933caec9
commit fdf3c7c33f
2 changed files with 3 additions and 3 deletions

View File

@ -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);
`,

View File

@ -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 {