Skip to content

Commit c92d516

Browse files
authored
Merge pull request #5 from VladimirIvanin/fix-change-input
change только по клику на инпут
2 parents 70dc76a + 79c665f commit c92d516

File tree

1 file changed

+8
-3
lines changed
  • packages/vuetify/src/mixins/selectable

1 file changed

+8
-3
lines changed

packages/vuetify/src/mixins/selectable/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import { h } from 'vue'
1111

1212
export function prevent (e: Event) {
1313
e.preventDefault()
14-
// всплытие провоцирует двойной onChange
15-
e.stopPropagation()
1614
}
1715

1816
/* @vue/component */
@@ -118,7 +116,14 @@ export default mixins(
118116
})
119117
},
120118
onClick (e: Event) {
121-
this.onChange()
119+
// тут задваиваются клики
120+
const target = e.target as HTMLElement
121+
const isCurrentClick = target.id === this.computedId
122+
const isRippleClick = target.classList.contains('v-input--selection-controls__ripple')
123+
124+
if (isCurrentClick || isRippleClick || !this.computedId) {
125+
this.onChange();
126+
}
122127
this.$emit('click', e)
123128
},
124129
onChange () {

0 commit comments

Comments
 (0)