Mattia Trapani
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
12 additions and
0 deletions
-
src/core/instance/render-helpers/check-keycodes.js
-
test/unit/features/directives/on.spec.js
|
@ -31,4 +31,5 @@ export function checkKeyCodes ( |
|
|
} else if (eventKeyName) { |
|
|
} else if (eventKeyName) { |
|
|
return hyphenate(eventKeyName) !== key |
|
|
return hyphenate(eventKeyName) !== key |
|
|
} |
|
|
} |
|
|
|
|
|
return eventKeyCode === undefined |
|
|
} |
|
|
} |
|
|
|
@ -976,6 +976,17 @@ describe('Directive v-on', () => { |
|
|
expect(value).toBe(1) |
|
|
expect(value).toBe(1) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
it('should not execute callback if modifiers are present', () => { |
|
|
|
|
|
vm = new Vue({ |
|
|
|
|
|
el, |
|
|
|
|
|
template: '<input @keyup.?="foo">', |
|
|
|
|
|
methods: { foo: spy } |
|
|
|
|
|
}) |
|
|
|
|
|
// simulating autocomplete event (Event object with type keyup but without keyCode)
|
|
|
|
|
|
triggerEvent(vm.$el, 'keyup') |
|
|
|
|
|
expect(spy.calls.count()).toBe(0) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
describe('dynamic arguments', () => { |
|
|
describe('dynamic arguments', () => { |
|
|
it('basic', done => { |
|
|
it('basic', done => { |
|
|
const spy = jasmine.createSpy() |
|
|
const spy = jasmine.createSpy() |
|
|