Md-Chip Rendering Issue within IOS(iPhone)
Bug, feature request, or proposal:
MD-Chips with "active" class that changes appearance(color) on selection
What is the expected behavior?
I added class"active" on selection. The md-chip would then change background color
What is the current behavior?
This actually works, however; in IOS any chips that are not in the current viewport would not render the correct background color once scrolled into view and clicked. The class "active" was being applied, but the class did not correctly change the appearance of the md-chip. Sometimes md-chips in the viewport would be clicked and the md-chip would have the correct appearnce, however; once scrolled out of view, then back into view, the md-chips appearance would be incorrect(background color would revert)
What are the steps to reproduce?
This only happens in actual iPhone devices. Emulator do not show the issue. I have a long list of chips that would extend beyond the viewport of an IOS device. I have a function attached to each md-chip
public setTags(selectedTag: string, event?: any): void { if (!event.target.classList.contains('active')) { this.render.setElementClass(event.target, 'active', true); } else { this.render.setElementClass(event.target, 'active', false); }
Scroll down and click on a chip. Click on md-chips in the viewport then scoll md-chips out of view and again back into view
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
using Angular version 4.1
Can you provide a plunker/stackblitz reproduction case? I was unable to reproduce this myself.
I'm experiencing the same issue with Angular 5.0.1.
Again, only on iPhone. I was able to reproduce the problem in the simulator too. If I tap a chip nothing happens (it's supposed to change color), but as soon as I scroll the change is applied. It's as if no repaint happens until the view is scrolled.
As a temporary fix, I'm forcing a repaint with a hack like this when a chip is clicked:
this.chips.nativeElement.style.display = 'none';
setTimeout(() => {
this.chips.nativeElement.style.display = 'inline-flex';
}, 0);
We haven't been able to reproduce this issue. Feel free to open a new issue if you are able to provide a reproduction via StackBlitz.
Yea unfortunately I could not simulate the issue anywhere. It only happened on iPhone devices. I believe I originally tested on an iPhone 6.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.