refactor: remove unnecessary if condition for linear element onKeyDown (#5486)
* refactor: remove unnecessary if condition for linear element onKeyDown * fix
This commit is contained in:
parent
f8b4bb66b4
commit
339212e563
@ -1872,13 +1872,12 @@ class App extends React.Component<AppProps, AppState> {
|
||||
this.state,
|
||||
);
|
||||
|
||||
if (
|
||||
selectedElements.length === 1 &&
|
||||
isLinearElement(selectedElements[0])
|
||||
) {
|
||||
if (selectedElements.length === 1) {
|
||||
if (isLinearElement(selectedElements[0])) {
|
||||
if (
|
||||
!this.state.editingLinearElement ||
|
||||
this.state.editingLinearElement.elementId !== selectedElements[0].id
|
||||
this.state.editingLinearElement.elementId !==
|
||||
selectedElements[0].id
|
||||
) {
|
||||
this.history.resumeRecording();
|
||||
this.setState({
|
||||
@ -1888,10 +1887,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||
),
|
||||
});
|
||||
}
|
||||
} else if (
|
||||
selectedElements.length === 1 &&
|
||||
!isLinearElement(selectedElements[0])
|
||||
) {
|
||||
} else {
|
||||
const selectedElement = selectedElements[0];
|
||||
|
||||
this.startTextEditing({
|
||||
@ -1902,6 +1898,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (
|
||||
!event.ctrlKey &&
|
||||
!event.altKey &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user