Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(useFocusWithin)!: rename type FocusWithinReturn to UseFocusWithinReturn #1866

Merged
merged 1 commit into from Jul 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/core/useFocusWithin/index.ts
Expand Up @@ -4,7 +4,7 @@ import type { MaybeElementRef } from '../unrefElement'
import { unrefElement } from '../unrefElement'
import { useActiveElement } from '../useActiveElement'
import type { ConfigurableWindow } from '../_configurable'
export interface FocusWithinReturn {
export interface UseFocusWithinReturn {
/**
* True if the element or any of its descendants are focused
*/
Expand All @@ -18,7 +18,7 @@ export interface FocusWithinReturn {
* @param target The target element to track
* @param options Focus within options
*/
export function useFocusWithin(target: MaybeElementRef, options: ConfigurableWindow = {}): FocusWithinReturn {
export function useFocusWithin(target: MaybeElementRef, options: ConfigurableWindow = {}): UseFocusWithinReturn {
const activeElement = useActiveElement(options)
const targetElement = computed(() => unrefElement(target))
const focused = computed(() => targetElement.value && activeElement.value ? targetElement.value.contains(activeElement.value) : false)
Expand Down