fix(app): keep session options button active while sharing
Avoid a one-frame active-state flicker when transitioning from the options dropdown to the share popover by treating the pending-share state as active until the popover opens.
This commit is contained in:
parent
5ca2dc87b7
commit
d2747d70d6
1 changed files with 8 additions and 2 deletions
|
|
@ -744,7 +744,11 @@ export function MessageTimeline(props: {
|
||||||
icon="dot-grid"
|
icon="dot-grid"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
class="size-6 rounded-md data-[expanded]:bg-surface-base-active"
|
class="size-6 rounded-md data-[expanded]:bg-surface-base-active"
|
||||||
|
classList={{
|
||||||
|
"bg-surface-base-active": share.open || title.pendingShare,
|
||||||
|
}}
|
||||||
aria-label={language.t("common.moreOptions")}
|
aria-label={language.t("common.moreOptions")}
|
||||||
|
aria-expanded={title.menuOpen || share.open || title.pendingShare}
|
||||||
ref={(el: HTMLButtonElement) => {
|
ref={(el: HTMLButtonElement) => {
|
||||||
more = el
|
more = el
|
||||||
}}
|
}}
|
||||||
|
|
@ -761,8 +765,10 @@ export function MessageTimeline(props: {
|
||||||
}
|
}
|
||||||
if (title.pendingShare) {
|
if (title.pendingShare) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
setTitle("pendingShare", false)
|
requestAnimationFrame(() => {
|
||||||
requestAnimationFrame(() => setShare({ open: true, dismiss: null }))
|
setShare({ open: true, dismiss: null })
|
||||||
|
setTitle("pendingShare", false)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue