tldraw/apps/docs/content/gen/preventDefault-function-1.mdx
alex c893a02878
remove lock option from highlighter (#1703)
Highlighter is autolocked, so we shouldn't show the lock icon 

### Change Type

- [x] `patch` — Bug fix


[^1]: publishes a `patch` release, for devDependencies use `internal`
[^2]: will not publish a new version

### Test Plan

1. Add a step-by-step description of how to test your PR here.
2.

- [ ] Unit Tests
- [ ] End to end tests

### Release Notes

- We no longer show the tool lock option for highlighter - it didn't do
anything anyway
2023-07-04 10:41:14 +00:00

49 lines
972 B
Text

---
title: preventDefault
status: published
category: editor
group: Function
author: api
date: 06/23/2023
order: 90
---<Small>Public Function</Small>
This function calls `event.preventDefault()` for you. Why is that useful?
Beacuase if you enable `window.preventDefaultLogging = true` it'll log out a message when it happens. Because we use console.warn rather than (log) you'll get a stack trace in the inspector telling you exactly where it happened. This is important because `e.preventDefault()` is the source of many bugs, but unfortuantly it can't be avoided because it also stops a lot of default behaviour which doesn't make sense in our UI
##### Parameters
<ParametersTable>
<ParametersTableRow>
<ParametersTableName>
`event`
</ParametersTableName>
<ParametersTableDescription>
```ts
Event | React.BaseSyntheticEvent
```
To prevent default on
</ParametersTableDescription>
</ParametersTableRow>
</ParametersTable>
##### Returns
```ts
void
```