Fix Emoji picker focus (#7217)
* Only portal the emoji picker where needed * Add optional portal prop to emoji picker * Use FocusScope to our advantage * Pare back, add guards, fix focus trap * Don't return focus to emoji button * Set DM input position on emoji insert * Let the caller determine next focus node --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||
import {postUriToRelativePath, toBskyAppUrl} from '#/lib/strings/url-helpers'
|
||||
import {purgeTemporaryImageFiles} from '#/state/gallery'
|
||||
import {precacheResolveLinkQuery} from '#/state/queries/resolve-link'
|
||||
import type {EmojiPickerPosition} from '#/view/com/composer/text-input/web/EmojiPicker.web'
|
||||
import * as Toast from '#/view/com/util/Toast'
|
||||
|
||||
export interface ComposerOptsPostRef {
|
||||
@@ -29,7 +30,7 @@ export interface ComposerOpts {
|
||||
onPost?: (postUri: string | undefined) => void
|
||||
quote?: AppBskyFeedDefs.PostView
|
||||
mention?: string // handle of user to mention
|
||||
openEmojiPicker?: (pos: DOMRect | undefined) => void
|
||||
openEmojiPicker?: (pos: EmojiPickerPosition | undefined) => void
|
||||
text?: string
|
||||
imageUris?: {uri: string; width: number; height: number; altText?: string}[]
|
||||
videoUri?: {uri: string; width: number; height: number}
|
||||
|
||||
Reference in New Issue
Block a user