Disabled creation of branches/tags/stashes with empty string on enter or whitespaces
This commit is contained in:
parent
7156a976dc
commit
8f2598d866
@ -44,7 +44,7 @@ fun NewBranchDialog(
|
|||||||
}
|
}
|
||||||
.width(300.dp)
|
.width(300.dp)
|
||||||
.onPreviewKeyEvent {
|
.onPreviewKeyEvent {
|
||||||
if (it.key == Key.Enter) {
|
if (it.key == Key.Enter && branchField.isNotBlank()) {
|
||||||
onAccept(branchField)
|
onAccept(branchField)
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
@ -79,7 +79,7 @@ fun NewBranchDialog(
|
|||||||
this.previous = branchFieldFocusRequester
|
this.previous = branchFieldFocusRequester
|
||||||
this.next = branchFieldFocusRequester
|
this.next = branchFieldFocusRequester
|
||||||
},
|
},
|
||||||
enabled = branchField.isNotEmpty(),
|
enabled = branchField.isNotBlank(),
|
||||||
onClick = {
|
onClick = {
|
||||||
onAccept(branchField)
|
onAccept(branchField)
|
||||||
},
|
},
|
||||||
|
@ -44,7 +44,7 @@ fun NewTagDialog(
|
|||||||
}
|
}
|
||||||
.width(300.dp)
|
.width(300.dp)
|
||||||
.onPreviewKeyEvent {
|
.onPreviewKeyEvent {
|
||||||
if (it.key == Key.Enter) {
|
if (it.key == Key.Enter && tagField.isBlank()) {
|
||||||
onAccept(tagField)
|
onAccept(tagField)
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
@ -79,7 +79,7 @@ fun NewTagDialog(
|
|||||||
this.previous = tagFieldFocusRequester
|
this.previous = tagFieldFocusRequester
|
||||||
this.next = tagFieldFocusRequester
|
this.next = tagFieldFocusRequester
|
||||||
},
|
},
|
||||||
enabled = tagField.isNotEmpty(),
|
enabled = tagField.isBlank(),
|
||||||
onClick = {
|
onClick = {
|
||||||
onAccept(tagField)
|
onAccept(tagField)
|
||||||
},
|
},
|
||||||
|
@ -44,7 +44,7 @@ fun StashWithMessageDialog(
|
|||||||
}
|
}
|
||||||
.width(300.dp)
|
.width(300.dp)
|
||||||
.onPreviewKeyEvent {
|
.onPreviewKeyEvent {
|
||||||
if (it.key == Key.Enter) {
|
if (it.key == Key.Enter && textField.isNotBlank()) {
|
||||||
onAccept(textField)
|
onAccept(textField)
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
@ -78,7 +78,7 @@ fun StashWithMessageDialog(
|
|||||||
this.previous = textFieldFocusRequester
|
this.previous = textFieldFocusRequester
|
||||||
this.next = textFieldFocusRequester
|
this.next = textFieldFocusRequester
|
||||||
},
|
},
|
||||||
enabled = textField.isNotEmpty(),
|
enabled = textField.isNotBlank(),
|
||||||
onClick = {
|
onClick = {
|
||||||
onAccept(textField)
|
onAccept(textField)
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user