Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown Split Button Emit Event on togglerTag Button Press #134

Closed
rabrowne85 opened this issue Jan 22, 2021 · 1 comment
Closed

Dropdown Split Button Emit Event on togglerTag Button Press #134

rabrowne85 opened this issue Jan 22, 2021 · 1 comment

Comments

@rabrowne85
Copy link

For the Dropdown there is no event emitted when the 'togglerTag' button is pressed. There is no way to attach a method to the togglerTag button in a parent component.

I think a simple change to the hide() method to check if it is a split toggle button and then emit on hide. Something like this:

hide () {
  this.visible = false
  if (this.splittedToggler) {
    this.$emit('update:splitButtonPress', val)
  }
},
@rabrowne85 rabrowne85 changed the title Dropdown Split Button Emit Event on non-toggle button press missing Dropdown Split Button Emit Event on togglerTag Button Press Jan 22, 2021
@rabrowne85
Copy link
Author

After a further review of the source code, it looks like there are a few other events that trigger the hide() function. As such amending the hide() function is not a suitable solution.

As such my revised proposal is to changed the component part of the splittedToggler to this:

<component
        :is="togglerTag"
        v-on="{ click: splittedToggler ? splitButtonPress : toggle }"
        :class="computedTogglerClasses"
        v-bind="splittedToggler ? '' : togglerAttrs"
      >

and then add the following additional function:

    splitButtonPress () {
      this.visible = false
      if (this.splittedToggler) {
        this.$emit('update:splitButtonPress', val)
      }
    },

leaving the hide() function as it was.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant