according to the Material Design Guide at
https://material.io/guidelines/componen ... lds-layout
the ULTIMA Template is missing support for placeholder and helper text
for form input fields
Explaination
Placeholder
The placeholder may be set as attribute to the input field but it will be covered up by the label.
Screenshot of actual behaviour when placeholder attribute is set
Screenshot of expected behaviour when placeholder attribute is set
Helper text
There is actually no way to set the helper text without doing some own css styling.
What I've seen is that input field error messages will appear right there where also the helper text should be.
So there is simply missing the sass style definition for .md-inputfield .ui-message .ui-message-info
and other message types.
Screenshot of expected feature
Is there any solution for this out there/ongoing?
Thx in advance
Solution
Here is how I helped myself and solved this issues by adding some sass in theme/_forms.scss
Placeholder
Adding the missing selectors input[placeholder] ~ label , [ng-reflect-placeholder] ~ label and textarea ~ label
to the class md-inputfield
moves label to top if placeholder is set
Helper text
Adding the missing css definitions
for the class "ui-messages-info"
allows you to use this message type as helper text
in the same manner as the message type "ui-messages-error"
Code: Select all
body {
/*
* Adding the missing selector s
* moves label to top if placeholder is set
*/
.md-inputfield {
// missing selectors
[ng-reflect-placeholder] ~ label, // p-calendar, p-slider, p-autoComplete, p-dropdown
textarea ~ label, // textareas
input[placeholder] ~ label, // input fields
input:focus ~ label,
input.ui-state-filled ~ label,
.ui-inputwrapper-focus ~ label,
.ui-inputwrapper-filled ~ label {
top: -20px;
font-size: 12px;
color:$primaryColor;
}
/*
* Adding the missing css definitions
* for the class "ui-messages-info"
* allows you to use this message type as helper text
* in the same manner as the message type "ui-messages-error"
*/
.ui-message {
background-color: transparent;
border: 0 none;
margin: 0px;
font-size: .75em;
color: $primaryColor;
&.ui-messages-info {
color: $primaryColor;
}
}
}
}