Skip to content

Commit

Permalink
feat(b-form-datepicker, b-form-timepicker): emit shown and hidden
Browse files Browse the repository at this point in the history
… events (#5004)

* feat(b-form-datepicker, b-form-timepicker): emit shown and hidden events

* Update form-timepicker.js

* Update package.json

* Update package.json

Co-authored-by: Jacob Müller <jacob.mueller.elz@gmail.com>
  • Loading branch information
tmorehouse and jacobmllr95 authored Mar 24, 2020
1 parent 68ad33f commit eb259b9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/form-datepicker/form-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,12 @@ export const BFormDatepicker = /*#__PURE__*/ Vue.extend({
try {
this.$refs.calendar.focus()
} catch {}
this.$emit('shown')
})
},
onHidden() {
this.isVisible = false
this.$emit('hidden')
},
// Render helpers
defaultButtonFn({ isHovered, hasFocus }) {
Expand Down
10 changes: 10 additions & 0 deletions src/components/form-datepicker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,16 @@
"type": "Object"
}
]
},
{
"event": "shown",
"version": "2.9.0",
"description": "Emitted when the picker popup has shown"
},
{
"event": "hidden",
"version": "2.9.0",
"description": "Emitted when the picker popup has hidden"
}
],
"slots": [
Expand Down
2 changes: 2 additions & 0 deletions src/components/form-timepicker/form-timepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,12 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({
try {
this.$refs.time.focus()
} catch {}
this.$emit('shown')
})
},
onHidden() {
this.isVisible = false
this.$emit('hidden')
},
// Render function helpers
defaultButtonFn({ isHovered, hasFocus }) {
Expand Down
10 changes: 10 additions & 0 deletions src/components/form-timepicker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,16 @@
"type": "Object"
}
]
},
{
"event": "shown",
"version": "2.9.0",
"description": "Emitted when the picker popup has shown"
},
{
"event": "hidden",
"version": "2.9.0",
"description": "Emitted when the picker popup has hidden"
}
],
"slots": [
Expand Down

0 comments on commit eb259b9

Please sign in to comment.