Browse Source

fix: Fixed issue with field dropdown

pull/6903/head
Muhammed Mustafa 1 year ago
parent
commit
e79adce2fe
  1. 10
      packages/nc-gui/components/nc/Dropdown.vue
  2. 9
      packages/nc-gui/components/smartsheet/details/Fields.vue

10
packages/nc-gui/components/nc/Dropdown.vue

@ -47,6 +47,14 @@ onClickOutside(overlayWrapperDomRef, () => {
visible.value = false visible.value = false
}) })
const onVisibleUpdate = (event: any) => {
if (visible !== undefined) {
visible.value = event
} else {
emits('update:visible', event)
}
}
</script> </script>
<template> <template>
@ -54,7 +62,7 @@ onClickOutside(overlayWrapperDomRef, () => {
:visible="visible" :visible="visible"
:trigger="trigger" :trigger="trigger"
:overlay-class-name="overlayClassNameComputed" :overlay-class-name="overlayClassNameComputed"
@update:visible="visible !== undefined ? (visible = $event) : undefined" @update:visible="onVisibleUpdate"
> >
<slot /> <slot />

9
packages/nc-gui/components/smartsheet/details/Fields.vue

@ -686,13 +686,11 @@ onMounted(async () => {
} }
}) })
watch(isColOptionDropdownOpen, () => { const onFieldOptionUpdate = () => {
if (isColOptionDropdownOpen.value === true) return
setTimeout(() => { setTimeout(() => {
isFieldIdCopied.value = false isFieldIdCopied.value = false
}, 200) }, 200)
}) }
</script> </script>
<template> <template>
@ -840,9 +838,9 @@ watch(isColOptionDropdownOpen, () => {
</NcButton> </NcButton>
<NcDropdown <NcDropdown
v-else v-else
v-model:visible="isColOptionDropdownOpen"
:trigger="['click']" :trigger="['click']"
overlay-class-name="nc-dropdown-table-explorer" overlay-class-name="nc-dropdown-table-explorer"
@update:visible="onFieldOptionUpdate"
@click.stop @click.stop
> >
<NcButton <NcButton
@ -976,6 +974,7 @@ watch(isColOptionDropdownOpen, () => {
v-else v-else
:trigger="['click']" :trigger="['click']"
overlay-class-name="nc-dropdown-table-explorer-display-column" overlay-class-name="nc-dropdown-table-explorer-display-column"
@update:visible="onFieldOptionUpdate"
@click.stop @click.stop
> >
<NcButton <NcButton

Loading…
Cancel
Save