1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-17 02:17:49 +00:00

Fix AB UX bugs

This commit is contained in:
Jérémie Pardou 2024-05-28 13:45:43 +00:00
parent d81da27adc
commit c17c002267
3 changed files with 13 additions and 1 deletions
web-frontend/modules/builder/components

View file

@ -224,7 +224,15 @@ export default {
*/
isSelected(newValue, old) {
if (newValue && !old) {
this.$el.scrollIntoView({ behavior: 'smooth', block: 'center' })
const rect = this.$el.getBoundingClientRect()
const isTopVisible =
rect.top >= 0 &&
rect.top <=
(window.innerHeight || document.documentElement.clientHeight)
if (!isTopVisible) {
this.$el.scrollIntoView({ behavior: 'smooth', block: 'start' })
}
}
},
/**

View file

@ -38,6 +38,9 @@ export default {
name: 'PageElement',
mixins: [applicationContextMixin],
inject: ['builder', 'page', 'mode'],
provide() {
return { mode: this.elementMode }
},
props: {
element: {
type: Object,

View file

@ -35,6 +35,7 @@ export default {
page: this.page,
mode,
formulaComponent: ApplicationBuilderFormulaInputGroup,
applicationContext: { builder: this.builder, page: this.page, mode },
}
},
props: {