refactor(radio): handleMouseDown focus logic

This commit is contained in:
07akioni 2020-07-22 17:11:08 +08:00
parent f5056c2643
commit 5c3b6e01db
3 changed files with 8 additions and 5 deletions

View File

@ -1,7 +1,7 @@
# CHANGELOG
## PENDING
### Refactors
- Refactor `n-tag` styles
- Refactor `n-tag` styles.
- Fix the problem that `n-data-table`'s `max-height` style is broken. https://bugs.chromium.org/p/chromium/issues/detail?id=1107223
## 1.5.1 (2020-07-20)

View File

@ -6,7 +6,7 @@
## 1.5.1 (2020-07-20)
### Features
- 为 `n-time-picker` 增加了 `disabled` 属性.
- 为 `n-time-picker` 增加了 `disabled` 属性
### Fixes
- 修正了 `n-radio`下的子元素无法获取焦点的问题

View File

@ -75,10 +75,13 @@ export default {
handleKeyUpEnter () {
this.toggle()
},
handleMouseDown (e) {
handleMouseDown () {
if (this.syntheticDisabled) return
// e.preventDefault()
this.$refs.input.focus()
setTimeout(() => {
if (!this.$el.contains(document.activeElement)) {
this.$refs.input.focus()
}
}, 0)
},
handleClick (e) {
this.$emit('click', e)