Description
Is it possible to avoid the setTimeout
? As you plan a future PR in material 2 repo, the team avoids using setTimeout
's.
You could take a look in MatAutocompleteTrigger.panelClosingActions
as it's shown over here: angular/components#3334 (comment)
Also, there are recommendations about coding in Material repo: https://github.com/angular/material2/blob/master/CODING_STANDARDS.md
I've noticed the code style is a very important aspect among the guys developing Material. Tests are mandatory. You'll have to write them.
And, above all that... ask them whether you should be doing it before spending time preparing your PR. Not all features in Material Repo are opened for direct contribution. This kind of feature seems to me it's something that should be part of the project core. So there's a guideline that any core feature must be exhaustively discussed (internally to Google). Force selection is in this step (you can be sure that a topic with more than 40 comments is not being ignored by the project leader, Jeremy).
Rejecting PR's is not so frequent, but if your work is out of sync with their timeline, it can be frozen for months or even years awaiting for a merging action (and it's possible that you'll have to rebase it then).
Dispite of all this bureaucracy thing, I think your component is very nice, and your examples are really great (but the setTimeout
thing... I don't like the idea of counting on timing to take actions - even in this case, where aparently you are just pushing the subscription to the end of the line in the event loop).
[edited]: shouldn't it be this.selectedValueSub = this.selectedValue.pipe(...