Skip to content

Commit

Permalink
Merge branch 'release/v0.22.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
holtwick committed Aug 7, 2024
2 parents 9c741f6 + 56d9d01 commit 70ea7b0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
10 changes: 6 additions & 4 deletions lib/basic/oui-draggable.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { timestamp, useEventListener } from '@vueuse/core'
import { useEventListener } from '@vueuse/core'
import { ref } from 'vue'
import type { LoggerInterface } from 'zeed'
import { Logger, getTimestamp } from 'zeed'
Expand All @@ -8,6 +8,7 @@ import type { OuiDraggableEvent } from './_types'
const props = defineProps<{
onlyTouch?: boolean
cancelEvents?: boolean
}>()
const emit = defineEmits<{
Expand Down Expand Up @@ -56,9 +57,10 @@ function translateTouchEvent(e: TouchEvent): OuiDraggableEvent {
}
function cancelEvent(e: TouchEvent) {
// log('sep cancel')
e?.stopPropagation()
e?.preventDefault()
if (props.cancelEvents) {
e?.stopPropagation()
e?.preventDefault()
}
}
function onMouseDown(e: TouchEvent) {
Expand Down
13 changes: 8 additions & 5 deletions lib/modal/oui-modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,14 @@ const dragY = ref(0)
async function checkClose(e: OuiDraggableEvent) {
// console.log('checkclose', dragY.value, e.timeMS, height.value / 3, e)
if (dragY.value > (height.value / 3) || (dragY.value > 40 && e.timeMS < 500))
if (dragY.value > (height.value / 3) || (dragY.value > 40 && e.timeMS < 500)) {
dragY.value = 0
await nextTick()
doClose()
await nextTick()
dragY.value = 0
}
else {
dragY.value = 0
}
}
</script>

Expand Down Expand Up @@ -156,7 +159,7 @@ async function checkClose(e: OuiDraggableEvent) {
v-focustrap
class="_modal_container"
only-touch
:style="{ transform: `translateY(${dragY}px)` }"
:style="dragY > 0 ? { transform: `translateY(${dragY}px)` } : undefined"
@move="e => dragY = -e.moveY"
@move-end="checkClose"
>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "oui-kit",
"type": "module",
"version": "0.22.2",
"version": "0.22.3",
"author": {
"email": "[email protected]",
"name": "Dirk Holtwick",
Expand Down

0 comments on commit 70ea7b0

Please sign in to comment.