3131 :with-label =" withLabel && !withFieldPlaceholder && step.length < 2"
3232 :is-value-set =" step.some((f) => f.uuid in values)"
3333 :attachments-index =" attachmentsIndex"
34- @click =" $emit('focus-step', stepIndex)"
34+ @click =" [ $emit('focus-step', stepIndex), maybeScrollOnClick(field, area)] "
3535 />
3636 </Teleport >
3737 </template >
@@ -109,6 +109,14 @@ export default {
109109 areaRefs: []
110110 }
111111 },
112+ computed: {
113+ isMobileContainer () {
114+ const root = this .$root .$el .parentNode .getRootNode ()
115+ const container = root .body || root .querySelector (' div' )
116+
117+ return container .style .overflow === ' hidden'
118+ }
119+ },
112120 beforeUpdate () {
113121 this .areaRefs = []
114122 },
@@ -121,14 +129,16 @@ export default {
121129 this .scrollIntoArea (field .areas [0 ])
122130 }
123131 },
132+ maybeScrollOnClick (field , area ) {
133+ if ([' text' , ' number' , ' cells' ].includes (field .type ) && this .isMobileContainer ) {
134+ this .scrollIntoArea (area)
135+ }
136+ },
124137 scrollIntoArea (area ) {
125138 const areaRef = this .areaRefs .find ((a ) => a .area === area)
126139
127140 if (areaRef) {
128- const root = this .$root .$el .parentNode .getRootNode ()
129- const container = root .body || root .querySelector (' div' )
130-
131- if (container .style .overflow === ' hidden' ) {
141+ if (this .isMobileContainer ) {
132142 this .scrollInContainer (areaRef .$el )
133143 } else {
134144 const targetRect = areaRef .$refs .scrollToElem .getBoundingClientRect ()
0 commit comments