fix: zoom functions (#739)

This commit is contained in:
mertmit
2022-03-16 19:12:19 +03:00
committed by GitHub
parent ca5107f599
commit d8db82ee8b
2 changed files with 13 additions and 1 deletions

View File

@@ -116,6 +116,18 @@ class Zoom extends ListComboBox {
this.$input.shadowRoot.querySelector('[part~="input"]').style.width = this[internal.state].inputsize
}
if (changed.inputPartType) {
const self = this
this.$input.setAttribute('step', '10')
this.$input.setAttribute('min', '0')
// Handle NumberSpinBox input.
this.$input.addEventListener('change', function (e) {
e.preventDefault()
const value = e.detail?.value
if (value) {
const changeEvent = new CustomEvent('change', { detail: { value } })
self.dispatchEvent(changeEvent)
}
})
// Wire up handler on new input.
this.addEventListener('close', (e) => {
e.preventDefault()