question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[MdListOption] value always boolean, selectChange/deselected events don't fire

See original GitHub issue

Bug, feature request, or proposal:

MdListOption’s output EventEmitters selectChange, and deselected do not fire when the item is selected/deselected.

What is the expected behavior?

They should activate the angular expression bound to them.

What is the current behavior?

Here’s the code block I’m working with:

<md-selection-list class="selection-content-list">
    <md-list-option class="list-item" (selectChange)="selectedItem($event)" (deselected)="deselectedItem($event)" [disabled]="selectionItem.disabled" *ngFor="let selectionItem of (elements | async)">
        <md-icon mdListIcon>folder</md-icon>
        <h4 mdLine>{{ selectionItem.name }}</h4>
    </md-list-option>
</md-selection-list>

The items visually update when being clicked on and off. The MdSelectionList’s selectedOptions variable updates properly. The selectChange and deselected EventEmitters are never activated.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular Material 2.0.0-beta.10

Is there anything else we should know?

Looking at the current code, it looks like they aren’t ever used or references apart from their declarations.

The focus and destroyed events seem to emit fine though.

Also the value variable for MdListOption is coerced to a boolean value so even using selectedOptions doesn’t make the MdListOption useable.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
glamprcommented, Sep 19, 2017

@dereekb created issue #7183 just in case you want to follow it.

1reaction
julianobrasilcommented, Sep 6, 2017

A plunk is always useful: https://plnkr.co/edit/6y5tPM?p=preview

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change boolean on (change) event - angular - Stack Overflow
I made it work, but instead of [value] in HTML, i just used value (without squarebrackets) for the buttons, so in the TypeScript...
Read more >
Toggle default event – On Value Changed (Boolean) - O'Reilly
This event will trigger whenever the toggle is selected or deselected. It can accept a Boolean argument. When a public function has a...
Read more >
Detecting value change without event case - NI Community
Solved: Hello Community! I have an application that uses a boolean controler to make a string controller visible. In this string controller ...
Read more >
True/False (Boolean) Field Behavior in ServiceNow
Change every query automatically to the database for these fields to include the OR <field> is null to ensure all matching records are...
Read more >
Is there any way to fire an event on boolean value change?
I got a bool in my blueprint, I want to fire an event once the bool value changes. Is there anyway to create...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found