tldraw/apps/examples
Taha f73bf9a7fe
Fix text-wrapping on Safari (#1980)
Co-authored-by: Alex Alex@dytry.ch

closes [#1978](https://github.com/tldraw/tldraw/issues/1978)

Text was wrapping on Safari because the measure text div was rendered
differently on different browsers. Interestingly, when forcing the
text-measure div to be visible and on-screen in Chrome, the same
text-wrapping behaviour was apparent. By setting white-space to 'pre'
when width hasn't been set by the user, we can ensure that only line
breaks the user has inputted are rendered by default on all browsers.

### Change Type

- [x] `patch` — Bug fix
- [ ] `minor` — New feature
- [ ] `major` — Breaking change
- [ ] `dependencies` — Changes to package dependencies[^1]
- [ ] `documentation` — Changes to the documentation only[^2]
- [ ] `tests` — Changes to any test code only[^2]
- [ ] `internal` — Any other changes that don't affect the published
package[^2]
- [ ] I don't know

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

### Test Plan

1. On Safari
2. Make a new text shape and start typing
3. At a certain point the text starts to wrap without the width having
been set


### Release Notes

- Fix text wrapping differently on Safari and Chrome/Firefox

Before/After

<image width="350"
src="https://github.com/tldraw/tldraw/assets/98838967/320171b4-61e0-4a41-b8d3-830bd90bea65">
<image width="350"
src="https://github.com/tldraw/tldraw/assets/98838967/b42d7156-0ce9-4894-9692-9338dc931b79">
2023-10-02 11:30:53 +00:00
..
e2e Fix text-wrapping on Safari (#1980) 2023-10-02 11:30:53 +00:00
src Remove focus management (#1953) 2023-10-02 11:29:54 +00:00
package.json Fix pinch start with toolbar open (#1895) 2023-09-18 10:50:15 +00:00
README.md transfer-out: transfer out 2023-04-25 12:01:25 +01:00
tsconfig.json Add snapshot prop, examples (#1856) 2023-09-08 14:48:55 +00:00
vercel.json [fix] example routes on vercel (#1391) 2023-05-16 14:37:40 +00:00
vite.config.ts Feature flags rework (#1474) 2023-05-30 13:06:15 +00:00

@tldraw/example