textfields: for unfilled geo shapes fix edit->edit

pull/3578/head
Mime Čuvalo 2024-04-23 15:38:46 +01:00
rodzic a319ad9497
commit 9c8e4b73fe
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: BA84499022AC984D
2 zmienionych plików z 12 dodań i 2 usunięć

Wyświetl plik

@ -1087,13 +1087,15 @@ input,
* One extra nuance is we don't use this behavior for:
* - arrows which have weird geometry and just gets in the way.
* - draw/line shapes, because it feels restrictive to have them be 'in the way' of clicking on a textfield
* - shapes that are not filled
*/
.tl-canvas[data-iseditinganything='true']
.tl-shape:not(
[data-shape-type='arrow'],
[data-shape-type='draw'],
[data-shape-type='line'],
[data-shape-type='highlight']
[data-shape-type='highlight'],
[data-shape-is-filled='false']
) {
pointer-events: all;
}

Wyświetl plik

@ -142,6 +142,8 @@ export const Shape = memo(function Shape({
if (!shape) return null
const isFilledShape = 'fill' in shape.props && shape.props.fill !== 'none'
return (
<>
{util.backgroundComponent && (
@ -156,7 +158,13 @@ export const Shape = memo(function Shape({
</OptionalErrorBoundary>
</div>
)}
<div ref={containerRef} className="tl-shape" data-shape-type={shape.type} draggable={false}>
<div
ref={containerRef}
className="tl-shape"
data-shape-type={shape.type}
data-shape-is-filled={isFilledShape}
draggable={false}
>
<OptionalErrorBoundary fallback={ShapeErrorFallback as any} onError={annotateError}>
<InnerShape shape={shape} util={util} />
</OptionalErrorBoundary>