Bulma Steps failing to advance to the next step despite clicking submit

I am currently working on implementing Buefy Steps in a Vue project. The Buefy steps are functioning correctly, but I am facing an issue where the 'Submit' button does not progress to the next step (e.g., from "Account" to "Profile").

App.vue:

<template>
  <div id="app">
    <section>
      <div class="block">
        <b-field v-if="hasNavigation" grouped group-multiline>
          <b-field label="Prev icon">
            <b-select v-model="prevIcon">
              <option value="chevron-left">Chevron</option>
              <option value="arrow-left">Arrow</option>
            </b-select>
          </b-field>
          <b-field label="Next icon">
            <b-select v-model="nextIcon">
              <option value="chevron-right">Chevron</option>
              <option value="arrow-right">Arrow</option>
            </b-select>
          </b-field>
          <b-field label="Label position">
            <b-select v-model="labelPosition">
              <option value="bottom">Bottom</option>
              <option value="right">Right</option>
              <option value="left">Left</option>
            </b-select>
          </b-field>
          <b-field label="Mobile mode">
            <b-select v-model="mobileMode">
              <option :value="null">-</option>
              <option value="minimalist">Minimalist</option>
              <option value="compact">Compact</option>
            </b-select>
          </b-field>
        </b-field>
      </div>
      <b-steps
        v-model="activeStep"
        :animated="isAnimated"
        :rounded="isRounded"
        :has-navigation="hasNavigation"
        :icon-prev="prevIcon"
        :icon-next="nextIcon"
        :label-position="labelPosition"
        :mobile-mode="mobileMode"
      >
        <b-step-item step="1" label="Account" :clickable="isStepsClickable">
          <h1 class="title has-text-centered">Account</h1>
          <form ref="loginForm" class="form-horizontal form-material" @submit.stop.prevent>
            <input type="hidden" name="customfield" class="form-control" :value="this.id">
            <div class="field is-horizontal">
              <div class="field-label is-normal">
                <label class="label has-text-black">Name *</label>
              </div>
              <div class="field-body">
                <div class="field">
                  <div class="control">
                    <b-field>
                      <input maxlength="20" class="input h" type="text" placeholder>
                    </b-field>
                  </div>
                </div>
              </div>
            </div>
            <div class="field is-grouped is-grouped-right"></div>
            <div class="field is-grouped is-grouped-centered">
              <p class="control">
                <a class="button is-primary" @click.prevent="next.action">Submit</a>
              </p>
              <p class="control">
                <a class="button is-light">Cancel</a>
              </p>
            </div>
          </form>
        </b-step-item>

        <b-step-item
          step="2"
          label="Profile"
          :clickable="isStepsClickable"
          :type="{'is-success': isProfileSuccess}"
        >
          <h1 class="title has-text-centered">Profile</h1>Lorem ipsum dolor sit amet.
        </b-step-item>

        <b-step-item step="3" :visible="showSocial" label="Social" :clickable="isStepsClickable">
          <h1 class="title has-text-centered">Social</h1>Lorem ipsum dolor sit amet.
        </b-step-item>

        <b-step-item
          :step="showSocial ? '4' : '3'"
          label="Finish"
          :clickable="isStepsClickable"
          disabled
        >
          <h1 class="title has-text-centered">Finish</h1>Lorem ipsum dolor sit amet.
        </b-step-item>
      </b-steps>
    </section>
  </div>
</template>

<script>
export default {
  name: "App"
};
</script>

<style>
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>

codesandbox

Answer №1

It seems like you may have accidentally moved the content from the b-step's navigation slot to b-step-item without including the necessary parent template to define the slot scope for next, which is crucial for the functionality of the Submit button. Even if you added the template, it still wouldn't work properly because b-step-item does not have a navigation slot.

To resolve this issue, you should place the buttons within b-step's navigation slot:

<b-step>
  <b-step-item>...</b-step-item>
  <b-step-item>...</b-step-item>
  <b-step-item>...</b-step-item>

  <template slot="navigation" slot-scope="{previous, next}">
    <div class="field is-grouped is-grouped-centered">
      <p class="control">
        <a class="button is-primary" @click.prevent="next.action">Submit</a>
      </p>
      <p class="control">
        <a class="button is-light">Cancel</a>
      </p>
    </div>
  </template>
</b-step>

Check out the updated codesandbox here

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Submitting a form with JQuery and Ajax technology

I am encountering an issue where I need to submit a form within Ajax and I keep getting a 'form.submit is not a function' error in jQuery. $("#form").validate({ // Define validation rules rules: { type: "required", group ...

What is the best way to display an AngularJS expression using a ternary operator?

Can AngularJS expressions be shown in a ternary operator? If so, can someone please provide guidance on how to achieve this? Thank you in advance. I have attempted the following, but it is not working as expected: {{ jdFile ? "Job Description File : {{fi ...

Retrieve all items pertaining to a specific week in the calendar

I'm trying to obtain a list of week ranges for all data in my MongoDB. When a week range is clicked, only the records for that specific week range should be displayed. By clicking on the week range, the ID of the week (let's say 42, representing ...

What is the best way to implement the Snackbar functionality within a class-based component?

My snackbar codes are not working as expected when I click the "confirm" button. I want the snackbar to appear after clicking the button. Most examples I've seen use functional components, so how can I get the Snackbar to work properly in a class comp ...

Can you explain how to achieve auto-assigning arrays in JavaScript similar to the PHP feature?

I'm seeking a way to update a JavaScript array automatically, without specifying a key as a number or string. The value should simply take the next available numeric key in the array. In PHP, you can achieve this using: <? myarray = array(); mya ...

Hold on for the processing of a CSV document

I am attempting to utilize the "csv-parse" library in Typescript to read a csv file by creating an observable. The code provided uses fs.createReadStream to read the file. I am looking to return the observable and subscribe to it, but it seems that the p ...

What could be causing Vuejs to not update elements promptly?

Currently, I am encountering a scenario where I am adding options to a select element using Vue.js when the @change event of that specific element is triggered. An issue arises where the new option is not 'registered' until I exit the function. ...

Retrieve the URL for the React component

I'm facing some challenges with React fundamentals :/ I have a piece of code that creates a table using JSON data: import React from 'react' import { DataTable } from 'react-data-components'; function createTable(data) { ...

Tips for adjusting the default selection in a second dropdown menu

I have a dilemma with my two dropdown lists, "optionone" and "optiontwo". I am trying to alter the default selected value from "option value=3>3" to option value=3 selected>3 when the user selects 2 from the first dropdown list ("optionone"). <sc ...

How can I populate an array to use in a datatable when rendering?

How can I ensure that my datatable renders with the proper data on my webpage without needing to interact with the sort button? Where should I populate the array for use in a datatable so that it occurs before the rendering? export function MyComponent() ...

Guide on triggering a modal upon receiving a function response in React

I am looking for a way to trigger a function call within a response so that I can open a modal. Currently, I am utilizing Material UI for the modal functionality. Learn more about Modals here The process involves: Clicking on a button Sending a request ...

Can you create reusable components in Wordpress that are encapsulated?

In my quest to explore innovative approaches to Wordpress theme development, I have stumbled upon a variety of options such as the "Roots Sage" starter theme, the "Themosis Framework," and "Flynt." While these solutions address intriguing problems, they do ...

The controller method in Laravel is not being triggered by AJAX

In my blade layout file, I have some code that is included in my view multiple times using the @include.layout("blade file link") syntax. When a button is pressed, I want to call a controller function. This works fine without AJAX, but when AJAX is added, ...

Glowing effects on svg shapes

I'm looking to add a pulsing light animation around an SVG half circle shape that I have created. After experimenting with CSS and Webkit, the closest I've come is achieving a pulsing light around the parent element, rather than the actual shape ...

The JSX in React won't display the modified state on the user interface

In my diary object, I have records of 2 meals function Magicdiary() { const [diary, setDiary] = React.useState<MagicDiaryDay[]>([ { mealName: "Breakfast", ingredient: null }, { mealName: "Lunch", ingredient: null }, ]) ...

Stop angular schema form's destroyStrategy from deleting any data

After upgrading my Angular app from version 0.8.2 to 0.8.3 of Angular Schema Form (ASF), a significant bug emerged. The application features multi-page forms that utilize prev/next buttons for navigation. A condition is implemented to display only relevan ...

Guide on integrating the Google Maps API SDK into a Native project

I recently tried implementing gmap on my web application by following a tutorial I found here: However, I am having trouble understanding how to use the API, specifically when it comes to utilizing a keystore for my API key. Can anyone provide guidance on ...

What is the proper way to address the issue of nesting ternary expressions when it comes to conditionally rendering components?

When using the code below, eslint detects errors: {authModal.mode === 'login' ? <Login /> : authModal.mode === 'register' ? <SignUp /> : <ForgotPassword />} Error: Avoid nesting ternary expressions. eslint(no-nested-t ...

Protractor: Moving further down the page

One issue I encountered is with a button on my page that becomes visible only when the user scrolls down. As a result, Protractor tests are throwing an error: UnknownError: unknown error: Element is not clickable at point (94, 188). I attempted to reso ...

Confirming if the value is an array using jQuery

Currently, I have a list of elements with various types associated with them. My goal is to identify specific text within these types and hide only those types that do not contain the desired text, leaving the rest unaffected. The structure looks like thi ...