Skip to content

Commit

Permalink
fix(color-picker): can't be closed if mousedown.stop is set when clic…
Browse files Browse the repository at this point in the history
…k outside, closes #2709
  • Loading branch information
07akioni committed Apr 10, 2022
1 parent aaa0aa6 commit 0b67751
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Fix `n-step` has unexpected theme variable class.
- Fix `n-steps` displays uncorrectly when nested in vertical & horizontal mode.
- Fix `n-popconfirm`'s `positive-text` & `negetive-text` props don't allow `null` type.
- Fix `n-color-picker` can't be closed if mousedown.stop is set when click outside, closes [#2709](https://github.com/TuSimple/naive-ui/issues/2709).

### Feats

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- 修复 `n-step` 有多余的主题变量类名
- 修复 `n-steps` 垂直水平相互嵌套样式错乱
- 修复 `n-popconfirm``positive-text` & `negetive-text` 不允许 `null` 类型
- 修复 `n-color-picker` 的面板关闭会被 `mousedown.stop` 阻止,关闭 [#2709](https://github.com/TuSimple/naive-ui/issues/2709)

### Feats

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"lodash-es": "^4.17.21",
"seemly": "^0.3.3",
"treemate": "^0.3.10",
"vdirs": "^0.1.7",
"vdirs": "^0.1.8",
"vfonts": "^0.0.3",
"vooks": "^0.2.12",
"vueuc": "^0.4.28"
Expand Down
10 changes: 10 additions & 0 deletions src/color-picker/demos/zhCN/close-debug.demo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<markdown>
# Close debug

</markdown>
<template>
<n-color-picker />
<n-button style="margin-left: 120px" @mousedown.stop>
Stop mousedown
</n-button>
</template>
1 change: 1 addition & 0 deletions src/color-picker/demos/zhCN/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ modes.vue
form.vue
swatches.vue
native.vue
close-debug.vue
```

## API
Expand Down
7 changes: 6 additions & 1 deletion src/color-picker/src/ColorPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,12 @@ export default defineComponent({
default: () =>
this.mergedShow
? withDirectives(this.renderPanel(), [
[clickoutside, this.handleClickOutside]
[
clickoutside,
this.handleClickOutside,
undefined as any as string,
{ capture: true }
]
])
: null
}}
Expand Down

0 comments on commit 0b67751

Please sign in to comment.