feat(desktop): papercut fixes (#34939)
This commit is contained in:
parent
caedf36844
commit
d46c02ba73
5 changed files with 23 additions and 6 deletions
|
|
@ -218,6 +218,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||
let scrollRef!: HTMLDivElement
|
||||
let slashPopoverRef!: HTMLDivElement
|
||||
let restoreEndOnFocus = true
|
||||
let savedCursor: number | null = null
|
||||
|
||||
const mirror = { input: false }
|
||||
const inset = 56
|
||||
|
|
@ -590,7 +591,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||
|
||||
const restoreFocus = () => {
|
||||
requestAnimationFrame(() => {
|
||||
const cursor = prompt.cursor() ?? promptLength(prompt.current())
|
||||
const cursor = savedCursor ?? prompt.cursor() ?? promptLength(prompt.current())
|
||||
editorRef.focus()
|
||||
setCursorPosition(editorRef, cursor)
|
||||
queueScroll()
|
||||
|
|
@ -627,6 +628,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||
const isImeComposing = (event: KeyboardEvent) => event.isComposing || composing() || event.keyCode === 229
|
||||
|
||||
const handleBlur = () => {
|
||||
savedCursor = currentCursor()
|
||||
closePopover()
|
||||
setComposing(false)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -399,7 +399,7 @@
|
|||
overflow: hidden;
|
||||
font-size: 13px;
|
||||
font-weight: 440;
|
||||
line-height: 1;
|
||||
line-height: 16px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { createSignal, Show, type JSXElement } from "solid-js"
|
|||
import "./titlebar-tab-popover.css"
|
||||
|
||||
// Initial hover delay before the preview appears, per design.
|
||||
const OPEN_DELAY = 200
|
||||
const OPEN_DELAY = 400
|
||||
// Mouse-out delay: begin closing immediately (a brief exit animation plays).
|
||||
const CLOSE_DELAY = 0
|
||||
// After a preview closes, hovering a neighbouring tab within this window skips
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue