Skip to content

Commit e715aaf

Browse files
committed
make potential refactor more obvious
1 parent 22b0408 commit e715aaf

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

custom-elements.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -201,18 +201,18 @@
201201
},
202202
{
203203
"kind": "field",
204-
"name": "onlyValidateOnBlur",
204+
"name": "validateOnKeystroke",
205205
"type": {
206206
"text": "boolean"
207-
},
208-
"readonly": true
207+
}
209208
},
210209
{
211210
"kind": "field",
212-
"name": "validateOnKeystroke",
211+
"name": "onlyValidateOnBlur",
213212
"type": {
214213
"text": "boolean"
215-
}
214+
},
215+
"readonly": true
216216
}
217217
],
218218
"attributes": [

src/auto-check-element.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,6 @@ export class AutoCheckElement extends HTMLElement {
188188
return AllowedHttpMethods[this.getAttribute('http-method') as keyof typeof AllowedHttpMethods] || 'POST'
189189
}
190190

191-
get onlyValidateOnBlur(): boolean {
192-
const value = this.getAttribute('only-validate-on-blur')
193-
return value === 'true' || value === ''
194-
}
195-
196191
set validateOnKeystroke(enabled: boolean) {
197192
if (enabled) {
198193
this.setAttribute('validate-on-keystroke', '')
@@ -205,6 +200,11 @@ export class AutoCheckElement extends HTMLElement {
205200
const value = this.getAttribute('validate-on-keystroke')
206201
return value === 'true' || value === ''
207202
}
203+
204+
get onlyValidateOnBlur(): boolean {
205+
const value = this.getAttribute('only-validate-on-blur')
206+
return value === 'true' || value === ''
207+
}
208208
}
209209

210210
function handleChange(checker: () => void, event: Event) {

0 commit comments

Comments
 (0)