fix browser zoom while editing text (#802)

This commit is contained in:
Judicael 2022-07-11 11:56:06 +03:00 committed by GitHub
parent b0755d8def
commit e6d3074f90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View file

@ -108,7 +108,9 @@ export class StickyUtil extends TDShapeUtil<T, E> {
e.preventDefault()
return
}
if ((e.metaKey || e.ctrlKey) && e.key === '=') {
e.preventDefault()
}
if (e.key === 'Tab') {
e.preventDefault()
if (e.shiftKey) {

View file

@ -103,6 +103,7 @@ export class TextUtil extends TDShapeUtil<T, E> {
...shape,
text: newText,
})
switch (shape.style.textAlign) {
case AlignStyle.Start: {
break
@ -162,7 +163,9 @@ export class TextUtil extends TDShapeUtil<T, E> {
e.preventDefault()
return
}
if ((e.metaKey || e.ctrlKey) && e.key === '=') {
e.preventDefault()
}
if (e.key === 'Tab') {
e.preventDefault()
if (e.shiftKey) {

View file

@ -65,6 +65,10 @@ export const TextLabel = React.memo(function TextLabel({
return
}
if ((e.metaKey || e.ctrlKey) && e.key === '=') {
e.preventDefault()
}
if (e.key === 'Tab') {
e.preventDefault()
if (e.shiftKey) {