Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

feat(input): add asterisk to input directive #6518

Closed
wants to merge 1 commit into from

Conversation

devversion
Copy link
Member

Fixes #6511

@devversion devversion force-pushed the feat/input-asterisk branch from ab0156a to 44efec8 Compare January 2, 2016 18:28
@devversion devversion force-pushed the feat/input-asterisk branch 2 times, most recently from 39a9934 to b57bbd0 Compare January 5, 2016 16:06
@EladBezalel EladBezalel added the needs: manual testing This issue or PR needs to have some manual testing and verification done label Jan 9, 2016
@EladBezalel EladBezalel added this to the 1.0.3 milestone Jan 9, 2016
@EladBezalel
Copy link
Member

LGTM

@@ -135,6 +135,7 @@ function labelDirective() {
* @param {string=} placeholder An alternative approach to using aria-label when the label is not
* PRESENT. The placeholder text is copied to the aria-label attribute.
* @param md-no-autogrow {boolean=} When present, textareas will not grow automatically.
* @param md-no-asterisk {boolean=} Stops appending of an asterisk to the label of required inputs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd change this to
When present, asterisk will not be appended to required inputs label
or something like that

@EladBezalel
Copy link
Member

@devversion the asterisk size is a bit larger than the spec, can you try and make it smaller?

@EladBezalel EladBezalel added needs: work and removed needs: manual testing This issue or PR needs to have some manual testing and verification done labels Jan 12, 2016
@devversion
Copy link
Member Author

@EladBezalel Okay, it's now smaller and still aligned at the top

@EladBezalel
Copy link
Member

looks better, the asterisk size shouldn't be changed but that's because the transform so fixing it will be over-kill.

Fix other comments and please add/change/ to the demo 1 input to have md-no-asterisk

@devversion
Copy link
Member Author

@EladBezalel - Done

@EladBezalel EladBezalel added pr: merge ready This PR is ready for a caretaker to review and removed needs: work labels Jan 12, 2016
@ThomasBurleson ThomasBurleson modified the milestones: 1.0.3, 1.0.4 Jan 22, 2016
@ThomasBurleson ThomasBurleson modified the milestones: 1.0.4, 1.0.5 Jan 30, 2016
@ThomasBurleson ThomasBurleson removed this from the 1.0.4 milestone Jan 30, 2016
@Emeegeemee
Copy link
Contributor

From looking at the spec for required fields, does this handle the label text becoming the warning color on blur?

@@ -91,6 +91,12 @@ md-input-container {
bottom: 100%;
@include rtl(left, 0, auto);
@include rtl(right, auto, 0);

&.md-required:after {
content: ' *';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the content reverse for rtl text?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asterisk will be aligned in the same direction as the other text, so it's compatible with RTL, LTR.
But it seems that the placeholders are aligned wrong? (See here.

But in general, Yes asterisk will be reversed for RTL text

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devversion I know this is old, but I thought I would update this since I just looked at it. The labels are properly "aligned" to the right, it's just that the width is not 100% of the parent. I guess we need to use right: 0 in addition to text-align: right here to fix?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, just looked a bit more; it's actually an issue with the scale(0.75) transform.

Looks like we can fix it with transform-origin: right;.

@devversion
Copy link
Member Author

@Emeegeemee - Yes it does -

@Emeegeemee
Copy link
Contributor

@devversion From your screenshot that looks like on focus not on blur. Please watch the demo carefully, when the focus is removed from the input in an invalid state the entire label goes red it doesn't go back to the black/grey color.

@EladBezalel
Copy link
Member

@Emeegeemee you can see it for yourself on input demo page

@Emeegeemee
Copy link
Contributor

@EladBezalel Thanks, from the site it looks to not make the label change red when focus is lost.

from the spec:
screenshot from 2016-02-01 14-40-35

current implementation:
screenshot from 2016-02-01 14-41-57

@EladBezalel
Copy link
Member

@Emeegeemee #6964

ErinCoughlan pushed a commit to ErinCoughlan/material that referenced this pull request Feb 9, 2016
@devversion devversion deleted the feat/input-asterisk branch April 21, 2016 12:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr: merge ready This PR is ready for a caretaker to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants