Skip to content

Commit

Permalink
Added change event to fields (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec authored Mar 9, 2022
1 parent 19a2305 commit 8340af8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fastybird/web-ui-theme",
"version": "0.9.0",
"version": "0.9.1",
"description": "FastyBird basic theme & Vue components for web apps",
"keywords": [
"fastybird",
Expand Down
3 changes: 2 additions & 1 deletion src/components/forms/FbInput/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,15 @@ export default defineComponent({
},
emits: ['update:modelValue', 'focus', 'blur', 'keydown', 'keyup'],
emits: ['update:modelValue', 'change', 'focus', 'blur', 'keydown', 'keyup'],
setup(_props: IFbFormInputProps, context: SetupContext) {
const isFocused = ref<boolean>(false)
// Emit an input event up to the parent
const onUpdateValue = (value: string | number | null): void => {
context.emit('update:modelValue', value)
context.emit('change', value)
}
// Fire focus & blur events
Expand Down
3 changes: 2 additions & 1 deletion src/components/forms/FbSelect/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default defineComponent({
},
emits: ['update:modelValue', 'focus', 'blur', 'change'],
emits: ['update:modelValue', 'change', 'focus', 'blur', 'change'],
setup(props: IFbFormSelectProps, context: SetupContext) {
const internalValue = ref<string | number | null>(props.modelValue)
Expand All @@ -205,6 +205,7 @@ export default defineComponent({
// Emit an input event up to the parent
const onUpdateValue = (value: string | number | null): void => {
context.emit('update:modelValue', value)
context.emit('change', value)
}
// Fire focus & blur events
Expand Down
3 changes: 2 additions & 1 deletion src/components/forms/FbTextArea/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,15 @@ export default defineComponent({
},
emits: ['update:modelValue', 'focus', 'blur', 'keydown', 'keyup'],
emits: ['update:modelValue', 'change', 'focus', 'blur', 'keydown', 'keyup'],
setup(_props: IFbFormTextAreaProps, context: SetupContext) {
const isFocused = ref<boolean>(false)
// Emit an input event up to the parent
const onUpdateValue = (value: string | number | null): void => {
context.emit('update:modelValue', value)
context.emit('change', value)
}
// Fire focus & blur events
Expand Down

0 comments on commit 8340af8

Please sign in to comment.