Skip to content

Commit

Permalink
fix: make label move on page load
Browse files Browse the repository at this point in the history
  • Loading branch information
PiemP committed Sep 11, 2023
1 parent 2a7da6f commit be2772c
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/js/plugins/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,11 @@ const createInput = (element) => {
return null
}

EventHandler.on(document, EVENT_MOUSEDOWN_DATA_API, 'input, textarea, label', function () {
const target = InputLabel.getInputFromLabel(this) || this
var frmel = document.querySelectorAll('input, textarea, label')
frmel.forEach(function (item, index, arr) {
const target = InputLabel.getInputFromLabel(item) || item
createInput(target)
})
EventHandler.on(document, EVENT_KEYUP_DATA_API, 'input, textarea, label', function () {
const target = InputLabel.getInputFromLabel(this) || this
const element = createInput(target)
if (element && element._label) {
element._label._labelOut()
}
})


export default Input

0 comments on commit be2772c

Please sign in to comment.