Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6cdd679

Browse files
koddssonmuan
andcommitted
s/auto-check-input/auto-check-start/
Co-authored-by: Mu-An Chiou <[email protected]>
1 parent 5a08c4c commit 6cdd679

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ check.addEventListener('error', function(event) {
4949

5050
### Auto-check events
5151

52-
**`auto-check-input`** is dispatched on when there has been input in the element. In `event.detail` you can find:
52+
**`auto-check-start`** is dispatched on when there has been input in the element. In `event.detail` you can find:
5353

5454
- `setValidity`: A function to provide a custom failure message on the input. By default it is 'Verifying…'.
5555

5656

5757
```js
5858
const input = check.querySelector('input')
5959

60-
input.addEventListener('auto-check-input', function(event) {
60+
input.addEventListener('auto-check-start', function(event) {
6161
const {setValidity} = event.detail
6262
setValidity('Loading validation')
6363
})

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function setLoadingState(event: Event) {
102102
let message = 'Verifying…'
103103
const setValidity = text => (message = text)
104104
input.dispatchEvent(
105-
new CustomEvent('auto-check-input', {
105+
new CustomEvent('auto-check-start', {
106106
bubbles: true,
107107
detail: {setValidity}
108108
})

test/test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe('auto-check element', function() {
7373
it('customizes the in-flight message', async function() {
7474
checker.src = '/fail'
7575
const send = new Promise(resolve => {
76-
input.addEventListener('auto-check-input', event => {
76+
input.addEventListener('auto-check-start', event => {
7777
event.detail.setValidity('Checking with server')
7878
resolve()
7979
})
@@ -181,14 +181,14 @@ describe('auto-check element', function() {
181181
triggerChange(input, 'hub')
182182
})
183183

184-
it('emits auto-check-input on input', function(done) {
185-
input.addEventListener('auto-check-input', () => done())
184+
it('emits auto-check-start on input', function(done) {
185+
input.addEventListener('auto-check-start', () => done())
186186
input.value = 'hub'
187187
input.dispatchEvent(new InputEvent('input'))
188188
})
189189

190-
it('emits auto-check-input on change', function(done) {
191-
input.addEventListener('auto-check-input', () => done())
190+
it('emits auto-check-start on change', function(done) {
191+
input.addEventListener('auto-check-start', () => done())
192192
triggerChange(input, 'hub')
193193
})
194194

0 commit comments

Comments
 (0)