mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 16:35:33 +00:00
Note: build.sh updated to make sure that test:help build action:target doesn't also call test.sh by adding `:_all` meta-target. Note: CI will need a new help-keyman-com.sh build step to deploy web engine help. Fixes: #12347
41 lines
770 B
Markdown
41 lines
770 B
Markdown
---
|
|
title: detachDOMEvent
|
|
---
|
|
|
|
## Summary
|
|
|
|
Detach DOM event handler from element to prevent memory leaks.
|
|
|
|
## Syntax
|
|
|
|
```c
|
|
keyman.util.detachDOMEvent();
|
|
```
|
|
|
|
### Parameters
|
|
|
|
`Pelem`
|
|
: Type: `Element`
|
|
: Element from which the event is being detached.
|
|
|
|
`eventName`
|
|
: Type: `string`
|
|
: The name of the event, without an 'on' prefix.
|
|
|
|
`handler`
|
|
: Type: `function(Object)`
|
|
: The event handler being detached.
|
|
|
|
`useCapture`
|
|
: Type: `boolean` *optional*
|
|
: Set this to `true` if the event was being captured in the bubbling phase; otherwise, use `false` or leave this parameter empty.
|
|
|
|
### Return Value
|
|
|
|
`undefined`
|
|
|
|
## Description
|
|
|
|
The fourth argument, useCapture, is optional and will default to false.
|
|
|
|
See also: [`keyman.util.attachDOMEvent`](attachDOMEvent)
|