Replies: 3 comments 5 replies
-
I solved it like this.Thank you all the same. // ...
private renderNativeInput() {
const input = document.createElement('input')
input.className = 'my-input--inner'
if (this.type) input.setAttribute('type', this.type)
if (this.value) input.setAttribute('value', this.value)
if (this.placeholder) input.setAttribute('placeholder', this.placeholder)
if (this.disabled) input.setAttribute('disabled', this.disabled)
if (this.readonly) input.setAttribute('readonly', this.readonly)
if (this.maxlength) input.setAttribute('maxlength', this.maxlength)
if (this.minlength) input.setAttribute('minlength', this.minlength)
if (this.name) input.setAttribute('name', this.name)
if (this.max) input.setAttribute('max', this.max)
if (this.min) input.setAttribute('min', this.min)
if (this.step) input.setAttribute('step', this.step)
if (this.autofocus) input.setAttribute('autofocus', this.autofocus)
return input
}
// ... |
Beta Was this translation helpful? Give feedback.
5 replies
-
Elevating this reply from @bicknellr, which is a good solution:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Has a method to enumerate attributes(like mapAttrs)? I can't enumerate attributes use the following way
Beta Was this translation helpful? Give feedback.
All reactions