Files
baserow/web-frontend/modules/builder/mixins/changeableFormElement.js
Jonathan Adelineandpeter_baserow 062a3f829d feat: add onClick and onChange events to more elements (#6686)
* feat(builder): add click events to images, text and headings

* fix(builder): allow element clicks to dismiss menus

* feat(builder): add click actions to columns and containers

* fix(builder): isolate nested interactive controls

* feat(builder): add selection change events

* test(builder): complete event fixtures for CI

* fix: keep heading semantics and limit click areas on clickable builder elements

---------

Co-authored-by: peter_baserow <peter@baserow.io>
2026-11-17 10:27:34 +04:00

30 lines
731 B
JavaScript

import _ from 'lodash'
import formElement from '@baserow/modules/builder/mixins/formElement'
export default {
mixins: [formElement],
methods: {
async onSelectionChange(value) {
if (this.workflowActionsInProgress) return
const changed = !_.isEqual(this.inputValue, value)
this.inputValue = value
this.handleFormElementChange()
if (
!changed ||
this.isEditMode ||
this.applicationContext.mode === 'editing'
) {
return
}
// Let formElement's watcher store the value before action formulas read it.
await this.$nextTick()
return this.fireEvent(
this.elementType.getEventByName(this.element, 'change')
)
},
},
}