Skip to content

Commit

Permalink
fix(useFocusWithin)!: rename type FocusWithinReturn to `UseFocusWit…
Browse files Browse the repository at this point in the history
…hinReturn` (#1866)
  • Loading branch information
okxiaoliang4 committed Jul 12, 2022
1 parent d484f8f commit 1b87160
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 1b87160

Please sign in to comment.