mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-23 20:54:50 +03:00
fix: Commit Input: Update the typing of the text areas
Update the typing of the text areas components inside the commit message input component. Also add guards against them being undefined
This commit is contained in:
parent
857cf7816c
commit
31f929269f
@ -52,8 +52,8 @@
|
||||
let aiLoading = false;
|
||||
let aiConfigurationValid = false;
|
||||
|
||||
let titleTextArea: HTMLTextAreaElement;
|
||||
let descriptionTextArea: HTMLTextAreaElement;
|
||||
let titleTextArea: HTMLTextAreaElement | undefined;
|
||||
let descriptionTextArea: HTMLTextAreaElement | undefined;
|
||||
|
||||
$: ({ title, description } = splitMessage(commitMessage));
|
||||
$: valid = !!title;
|
||||
@ -138,7 +138,7 @@
|
||||
if (e.key === KeyName.Delete && value.length === 0) {
|
||||
e.preventDefault();
|
||||
if (titleTextArea) {
|
||||
titleTextArea?.focus();
|
||||
titleTextArea.focus();
|
||||
titleTextArea.selectionStart = titleTextArea.textLength;
|
||||
}
|
||||
autoHeight(e.currentTarget);
|
||||
@ -178,9 +178,11 @@
|
||||
: `${toMove}\n${description}`;
|
||||
commitMessage = concatMessage(toKeep, newDescription);
|
||||
tick().then(() => {
|
||||
descriptionTextArea?.focus();
|
||||
descriptionTextArea.setSelectionRange(0, 0);
|
||||
autoHeight(descriptionTextArea);
|
||||
if (descriptionTextArea) {
|
||||
descriptionTextArea.focus();
|
||||
descriptionTextArea.setSelectionRange(0, 0);
|
||||
autoHeight(descriptionTextArea);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user