textfields: fix regression with Text shape and resizing (#3333)
The refactor of the textfields in this PR https://github.com/tldraw/tldraw/pull/3050 caused a regression in resizing Text shapes. (as demonstrated in this PR's video: https://github.com/tldraw/tldraw/pull/3327) We reverted that PR and now this PR updates the CSS to fix the gap that was introduced when it was refactored. ### Change Type <!-- ❗ Please select a 'Scope' label ❗️ --> - [x] `sdk` — Changes the tldraw SDK - [ ] `dotcom` — Changes the tldraw.com web app - [ ] `docs` — Changes to the documentation, examples, or templates. - [ ] `vs code` — Changes to the vscode plugin - [ ] `internal` — Does not affect user-facing stuff <!-- ❗ Please select a 'Type' label ❗️ --> - [x] `bugfix` — Bug fix - [ ] `feature` — New feature - [ ] `improvement` — Improving existing features - [ ] `chore` — Updating dependencies, other boring stuff - [ ] `galaxy brain` — Architectural changes - [ ] `tests` — Changes to any test code - [ ] `tools` — Changes to infrastructure, CI, internal scripts, debugging tools, etc. - [ ] `dunno` — I don't know
This commit is contained in:
parent
843347bde1
commit
03e4c8575c
2 changed files with 14 additions and 23 deletions
|
@ -697,7 +697,8 @@ input,
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
border: none;
|
border: none;
|
||||||
height: 100%;
|
width: fit-content;
|
||||||
|
height: fit-content;
|
||||||
font-variant: normal;
|
font-variant: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
pointer-events: all;
|
pointer-events: all;
|
||||||
|
@ -806,6 +807,17 @@ input,
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tl-text-content__wrapper {
|
||||||
|
position: relative;
|
||||||
|
width: fit-content;
|
||||||
|
height: fit-content;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
pointer-events: none;
|
||||||
|
min-height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.tl-text-content {
|
.tl-text-content {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
@ -1015,17 +1027,6 @@ input,
|
||||||
pointer-events: all;
|
pointer-events: all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tl-text-label__inner {
|
|
||||||
position: relative;
|
|
||||||
width: fit-content;
|
|
||||||
height: fit-content;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
pointer-events: none;
|
|
||||||
min-height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tl-text-label__inner > .tl-text-content {
|
.tl-text-label__inner > .tl-text-content {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
|
@ -1114,17 +1115,7 @@ input,
|
||||||
|
|
||||||
.tl-arrow-label textarea {
|
.tl-arrow-label textarea {
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
margin: 0px;
|
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
position: absolute;
|
|
||||||
resize: none;
|
|
||||||
border: 0px;
|
|
||||||
user-select: all;
|
|
||||||
-webkit-user-select: text;
|
|
||||||
caret-color: var(--color-text);
|
|
||||||
border-image: none;
|
|
||||||
/* Don't allow textarea to be zero width */
|
/* Don't allow textarea to be zero width */
|
||||||
min-width: 4px;
|
min-width: 4px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ export const TextLabel = React.memo(function TextLabel({
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={`${cssPrefix}-label__inner`}
|
className={`${cssPrefix}-label__inner tl-text-content__wrapper`}
|
||||||
style={{
|
style={{
|
||||||
fontSize,
|
fontSize,
|
||||||
lineHeight: fontSize * lineHeight + 'px',
|
lineHeight: fontSize * lineHeight + 'px',
|
||||||
|
|
Loading…
Reference in a new issue