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(useMouse): updated scroll value #4191

Closed
wants to merge 22 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0966297
fix(useMouse): updated scroll value
pkc918 Sep 2, 2024
8efaa2d
chore: rename `pre` to `rev`
pkc918 Sep 2, 2024
187ff69
fix(useMouse): record the value of the previous scroll
pkc918 Sep 22, 2024
af30e67
fix(computedAsync): type signature (#4207)
ferferga Sep 12, 2024
1c6e860
fix(useIntersectionObserver): add `Document` type for root (#4210)
phk422 Sep 12, 2024
9b6b463
feat(useCurrentElement): try to infer type from `$el` (#4202)
KazariEX Sep 12, 2024
11fc816
docs(onKeyStroke): fix arrow down & up cause scroll event (#4199)
ArthurDarkstone Sep 12, 2024
af5b54d
fix(useMouseInElement): allow `el` to be instanceof Element (#4189)
FRSgit Sep 12, 2024
dd98b36
fix(onClickOutside): make `ignore` accept reactive values (#4211)
cernymatej Sep 12, 2024
81d59a4
fix(useDraggable): draggable component not work with container (#4192)
huiliangShen Sep 12, 2024
bed0a18
fix(useFocusWithin): make useFocusWhithin match the behavior of the :…
ben-lau Sep 12, 2024
02e0607
feat(useFileDialog): return `onCancel` handler (#4184)
AndreyYolkin Sep 12, 2024
528fed9
fix(onClickOutside): improve cross-browser compatibility (#4185)
Onion-L Sep 12, 2024
c8b7852
docs: typo in `useShare` docs (#4228)
AkaraChen Sep 16, 2024
383863c
fix(useResizeObserver): update type (#4218)
phk422 Sep 16, 2024
b82041b
fix(useNetwork): return immutable values (#4187)
rudnovd Sep 16, 2024
0c543ce
feat(useDropZone): add multiple prop to control multi-file drop (#4227)
danngossinga Sep 16, 2024
85db06f
fix(useInfiniteScroll): stop watch when unmounted (#4110)
zyyv Sep 16, 2024
6b2e810
fix(useArrayFilter): match type to Array.prototype.filter (#4175)
Jesse205 Sep 16, 2024
67647e8
chore: update deps, lint
antfu Sep 16, 2024
5be352b
chore: release v11.1.0
antfu Sep 16, 2024
5a65a1f
chore: update deps
antfu Sep 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(onClickOutside): make ignore accept reactive values (#4211)
  • Loading branch information
cernymatej authored and pkc918 committed Sep 22, 2024
commit dd98b361a779b68d3fd69e35e44d8775d0dc442c
8 changes: 4 additions & 4 deletions packages/core/onClickOutside/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Fn } from '@vueuse/shared'
import { isIOS, noop } from '@vueuse/shared'
import type { Fn, MaybeRefOrGetter } from '@vueuse/shared'
import { isIOS, noop, toValue } from '@vueuse/shared'
import type { MaybeElementRef } from '../unrefElement'
import { unrefElement } from '../unrefElement'
import { useEventListener } from '../useEventListener'
Expand All @@ -10,7 +10,7 @@ export interface OnClickOutsideOptions extends ConfigurableWindow {
/**
* List of elements that should not trigger the event.
*/
ignore?: (MaybeElementRef | string)[]
ignore?: MaybeRefOrGetter<(MaybeElementRef | string)[]>
/**
* Use capturing phase for internal event listener.
* @default true
Expand Down Expand Up @@ -57,7 +57,7 @@ export function onClickOutside<T extends OnClickOutsideOptions>(
let shouldListen = true

const shouldIgnore = (event: PointerEvent) => {
return ignore.some((target) => {
return toValue(ignore).some((target) => {
if (typeof target === 'string') {
return Array.from(window.document.querySelectorAll(target))
.some(el => el === event.target || event.composedPath().includes(el))
Expand Down