mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-09 10:37:22 +02:00
fix: frame name field (#7457)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
@@ -1299,10 +1299,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||
const FRAME_NAME_EDIT_PADDING = 6;
|
||||
|
||||
const reset = () => {
|
||||
if (f.name?.trim() === "") {
|
||||
mutateElement(f, { name: null });
|
||||
}
|
||||
|
||||
mutateElement(f, { name: f.name?.trim() || null });
|
||||
this.setState({ editingFrame: null });
|
||||
};
|
||||
|
||||
@@ -1325,6 +1322,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||
name: e.target.value,
|
||||
});
|
||||
}}
|
||||
onFocus={(e) => e.target.select()}
|
||||
onBlur={() => reset()}
|
||||
onKeyDown={(event) => {
|
||||
// for some inexplicable reason, `onBlur` triggered on ESC
|
||||
|
Reference in New Issue
Block a user