mat-input DOM order of label and input
Bug, feature request, or proposal:
Proposal
What is the expected behavior?
It would be ideal if the label came before the input in the DOM order for the mat-input. Useful for adding your own custom styles if you want the functionality default look of inputs. This would also be useful if CSS were disabled.
What is the current behavior?
Label comes after input, however it has the appropriate aria labels and markup to associate the label with the input.
What are the steps to reproduce?
Providing a StackBlitz/Plunker (or similar) is the best way to get the team to see your issue.
Plunker starter (using on @master): https://goo.gl/DlHd6U
StackBlitz starter (using latest npm release): https://goo.gl/wwnhMV
DOM order

CSS disabled

What is the use-case or motivation for changing an existing behavior?
For applying custom styling to make form fields look like traditional inputs can cause complications when DOM order is flipped. Also useful if CSS was disabled.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Material 2.0.0-beta.11
For reference, the reason for this DOM order is to allow us to use the autofill selectors to float the label when the input has been pre-filled by the browser.
@crisbeto I haven't looked at the details of the styling for floating the label, but I'm guessing it's not something resolved by flexbox and order?
It's not. If you look at this, the selector depends on the input coming before the label in the DOM order.
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.
Find more details about Angular's feature request process in our documentation.
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.
We're in the process of cleaning up our issue backlog. I'm closing this issue, because there hasn't been any activity in a long time and the current DOM structure is intentional.
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.