Skip to content

Commit

Permalink
pkp/pkp-lib#10473 Submission wizard stepper glitches at widths of 104…
Browse files Browse the repository at this point in the history
…0px and below (#427)

* pkp/pkp-lib#10473 Fix the glitch in stepper collapsed mode

* pkp/pkp-lib#10473 Wrap the button stepper in a span to correct the calculation of width for small screen responsiveness
  • Loading branch information
blesildaramirez authored Oct 21, 2024
1 parent 5b972e8 commit 7ea641e
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions src/components/Steps/Steps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,34 @@
}"
>
<template v-if="startedSteps.includes(step.id)">
<button
:ref="'button' + step.id"
class="pkpSteps__step__label"
:class="
current === step.id
? 'pkpSteps__step__label--current'
: completedSteps.includes(step.id)
? 'pkpSteps__step__label--completed'
: ''
"
@click="setCurrent(step.id)"
>
<span class="pkpSteps__step__number">
<template
v-if="current !== step.id && completedSteps.includes(step.id)"
>
<Icon icon="check" />
</template>
<template v-else>
{{ i + 1 }}
</template>
</span>
{{ step.label }}
</button>
<span>
<button
:ref="'button' + step.id"
class="pkpSteps__step__label"
:class="
current === step.id
? 'pkpSteps__step__label--current'
: completedSteps.includes(step.id)
? 'pkpSteps__step__label--completed'
: ''
"
@click="setCurrent(step.id)"
>
<span class="pkpSteps__step__number">
<template
v-if="
current !== step.id && completedSteps.includes(step.id)
"
>
<Icon icon="check" />
</template>
<template v-else>
{{ i + 1 }}
</template>
</span>
{{ step.label }}
</button>
</span>
</template>
<template v-else>
<span :ref="'button' + step.id" class="pkpSteps__step__label">
Expand Down Expand Up @@ -217,7 +221,7 @@ export default {
*/
maybeToggleCollapsedView() {
const totalWidth = this.$refs.buttons.offsetWidth;
const allSteps = this.$refs.buttons.querySelectorAll('li');
const allSteps = this.$refs.buttons.querySelectorAll('li>span');
const allStepsWidth = Array.prototype.slice
.call(allSteps)
.reduce((totalWidth, button) => {
Expand Down

0 comments on commit 7ea641e

Please sign in to comment.