Skip to content

chore: next release #1809

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

Merged
merged 3 commits into from
Mar 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @vue-flow/core

## 1.42.5

### Patch Changes

- [#1807](https://github.com/bcakmakoglu/vue-flow/pull/1807) [`60482cf`](https://github.com/bcakmakoglu/vue-flow/commit/60482cf983d9f674070a48bdfd0624fe6e28a110) Thanks [@bcakmakoglu](https://github.com/bcakmakoglu)! - Prevent keypress events from being swallowed when a button element is focused.

## 1.42.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-flow/core",
"version": "1.42.4",
"version": "1.42.5",
"private": false,
"license": "MIT",
"author": "Burak Cakmakoglu<[email protected]>",
Expand Down
18 changes: 14 additions & 4 deletions packages/core/src/composables/useKeyPress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ type PressedKeys = Set<string>
type KeyOrCode = 'key' | 'code'

export interface UseKeyPressOptions {
actInsideInputWithModifier?: MaybeRefOrGetter<boolean>
target?: MaybeRefOrGetter<EventTarget | null | undefined>
actInsideInputWithModifier?: MaybeRefOrGetter<boolean>
preventDefault?: MaybeRefOrGetter<boolean>
}

const inputTags = ['INPUT', 'SELECT', 'TEXTAREA']

export function isInputDOMNode(event: KeyboardEvent): boolean {
const target = (event.composedPath?.()?.[0] || event.target) as HTMLElement

Expand All @@ -19,12 +22,12 @@ export function isInputDOMNode(event: KeyboardEvent): boolean {
const closest = typeof target?.closest === 'function' ? target.closest('.nokey') : null

// when an input field is focused we don't want to trigger deletion or movement of nodes
return ['INPUT', 'SELECT', 'TEXTAREA'].includes(target?.nodeName) || hasAttribute || !!closest
return inputTags.includes(target?.nodeName) || hasAttribute || !!closest
}

// we want to be able to do a multi selection event if we are in an input field
function wasModifierPressed(event: KeyboardEvent) {
return event.ctrlKey || event.metaKey || event.shiftKey
return event.ctrlKey || event.metaKey || event.shiftKey || event.altKey
}

function isKeyMatch(pressedKey: string, keyToMatch: string, pressedKeys: Set<string>, isKeyUp: boolean) {
Expand Down Expand Up @@ -88,6 +91,8 @@ export function useKeyPress(keyFilter: MaybeRefOrGetter<KeyFilter | boolean | nu

const target = toRef(() => toValue(options?.target) ?? window)

const preventDefault = toRef(() => toValue(options?.preventDefault) ?? true)

const isPressed = ref(toValue(keyFilter) === true)

let modifierPressed = false
Expand Down Expand Up @@ -124,7 +129,12 @@ export function useKeyPress(keyFilter: MaybeRefOrGetter<KeyFilter | boolean | nu
return
}

e.preventDefault()
const target = (e.composedPath?.()?.[0] || e.target) as Element | null
const isInteractiveElement = target?.nodeName === 'BUTTON' || target?.nodeName === 'A'

if (!preventDefault.value && (modifierPressed || !isInteractiveElement)) {
e.preventDefault()
}

isPressed.value = true
},
Expand Down
6 changes: 6 additions & 0 deletions packages/minimap/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @vue-flow/minimap

## 1.5.3

### Patch Changes

- [#1809](https://github.com/bcakmakoglu/vue-flow/pull/1809) [`b60c526`](https://github.com/bcakmakoglu/vue-flow/commit/b60c526c7f577663329e1d40e461b599dfaf0bd8) Thanks [@bcakmakoglu](https://github.com/bcakmakoglu)! - Filter hidden nodes from minimap bounds

## 1.5.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/minimap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-flow/minimap",
"version": "1.5.2",
"version": "1.5.3",
"private": false,
"license": "MIT",
"author": "Burak Cakmakoglu<[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion packages/minimap/src/MiniMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const nodeClassNameFunc = computed<MiniMapNodeFunc>(() =>
typeof nodeClassName === 'string' ? () => nodeClassName : typeof nodeClassName === 'function' ? nodeClassName : () => '',
)

const bb = computed(() => getRectOfNodes(getNodesInitialized.value))
const bb = computed(() => getRectOfNodes(getNodesInitialized.value.filter((node) => !node.hidden)))

const viewBB = computed(() => ({
x: -viewport.value.x / viewport.value.zoom,
Expand Down
Loading