Skip to content

Commit

Permalink
Fix bug where initial field value was blank
Browse files Browse the repository at this point in the history
  • Loading branch information
cavis committed Aug 16, 2023
1 parent 0b1d169 commit 3ef1257
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/javascript/controllers/flatpickr_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default class extends Controller {
this.element.removeAttribute("name")
this.element.insertAdjacentHTML("afterend", `<input type="hidden" name="${name}">`)
this.hiddenField = this.element.nextSibling
this.hiddenField.value = this.element.value
}

this.picker = flatpickr(this.element, {
Expand Down

0 comments on commit 3ef1257

Please sign in to comment.