Quantcast
Viewing all articles
Browse latest Browse all 4827

Make clicked button look active, other buttons should look inactive

@ousikaa wrote:

Hi everyone,

So I have a group of buttons and each button is its own component. When I click on a button component, I set its 'isActive' property to true, which will add a class to distinguish it from unclicked button components. But when I click on another button component, I want to set 'isActive` to false on the previous clicked button component so that only one button component ever looks like it's toggled active. How would I do this the Ember way? Is it not a good idea to make each button its own component?

Here is a link to a simple twiddle example: https://ember-twiddle.com/e06d287600d72c123a34df81bf3afd16?numColumns=2&openFiles=styles.app.css%2Cstyles.app.css

Let me know if I can do anything else to help you help me, thanks.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4827

Trending Articles