Add cancel control to issue comment composer
This commit is contained in:
@@ -11167,6 +11167,8 @@ private fun IssueCommentInputBar(
|
|||||||
var mentionPickerOpen by remember { mutableStateOf(false) }
|
var mentionPickerOpen by remember { mutableStateOf(false) }
|
||||||
var mentionQuery by remember { mutableStateOf("") }
|
var mentionQuery by remember { mutableStateOf("") }
|
||||||
var commentFocused by remember { mutableStateOf(false) }
|
var commentFocused by remember { mutableStateOf(false) }
|
||||||
|
val focusManager = LocalFocusManager.current
|
||||||
|
val keyboard = LocalSoftwareKeyboardController.current
|
||||||
val configuration = LocalConfiguration.current
|
val configuration = LocalConfiguration.current
|
||||||
val focusedComposerHeight = ChatExperiencePolicy.focusedComposerHeightPx(
|
val focusedComposerHeight = ChatExperiencePolicy.focusedComposerHeightPx(
|
||||||
ChatExperiencePolicy.Route.ISSUE_COMMENT,
|
ChatExperiencePolicy.Route.ISSUE_COMMENT,
|
||||||
@@ -11294,6 +11296,21 @@ private fun IssueCommentInputBar(
|
|||||||
tone = if (mentionPickerOpen) MulticaButtonTone.Primary else MulticaButtonTone.Secondary,
|
tone = if (mentionPickerOpen) MulticaButtonTone.Primary else MulticaButtonTone.Secondary,
|
||||||
modifier = composerActionModifier,
|
modifier = composerActionModifier,
|
||||||
)
|
)
|
||||||
|
if (commentFocused || mentionPickerOpen) {
|
||||||
|
MulticaIconPillButton(
|
||||||
|
icon = Icons.Outlined.Close,
|
||||||
|
contentDescription = "Issue Comment Cancel Input",
|
||||||
|
onClick = {
|
||||||
|
mentionPickerOpen = false
|
||||||
|
mentionQuery = ""
|
||||||
|
commentFocused = false
|
||||||
|
focusManager.clearFocus(force = true)
|
||||||
|
keyboard?.hide()
|
||||||
|
},
|
||||||
|
tone = MulticaButtonTone.Ghost,
|
||||||
|
modifier = composerActionModifier,
|
||||||
|
)
|
||||||
|
}
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
MulticaIconPillButton(
|
MulticaIconPillButton(
|
||||||
icon = Icons.AutoMirrored.Outlined.Send,
|
icon = Icons.AutoMirrored.Outlined.Send,
|
||||||
|
|||||||
Reference in New Issue
Block a user