Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MD: inputs should have success/error highlighting #5052

Closed
mhartington opened this issue Jan 18, 2016 · 6 comments
Closed

MD: inputs should have success/error highlighting #5052

mhartington opened this issue Jan 18, 2016 · 6 comments
Assignees

Comments

@mhartington
Copy link
Member

From @brandyscarney on December 1, 2015 16:59

9914f97f2de4e723b833f175785bb85c0ecbb587

Copied from original issue: driftyco/ionic2#678

@brandyscarney
Copy link
Member

I've had people ask how to disable highlighting so I am going to add the comment here:

The success/error highlighting can be turned off via the following Sass variables:

$text-input-md-show-success-highlight:      false;
$text-input-md-show-error-highlight:        false;

and to change the colors use the following variables:

// Input highlight - normal
$text-input-md-highlight-color:             color($colors-md, primary);

// Input highlight - valid
$text-input-md-hightlight-color-valid:      color($colors-md, secondary);

// Input highlight - invalid
$text-input-md-hightlight-color-invalid:    color($colors-md, danger);

Please add any feedback on this issue, Thanks!

@Chuckv01
Copy link

Chuckv01 commented Jun 21, 2016

The input highlighting does not fit in an ion-item with a left floated image. It overruns the width of the input and adds a border under the entire item, instead of just the input area.

screen shot 2016-06-21 at 2 00 16 pm

@jgw96 jgw96 modified the milestones: 2.0.0-beta.11, 2.0.0-beta.10 Jun 27, 2016
@mnasyrov
Copy link

mnasyrov commented Jul 7, 2016

I want to suggest to add a new 'success' Sass variable to color array for a color of success/valid states. Because it is not handy to override sass variables for each platform (md, wp) to make a right color for input's valid state in case the secondary color is not green (e.g. pink or red).

brandyscarney added a commit that referenced this issue Jul 15, 2016
The input highlight can now be enabled for ios. Fixed wp’s
valid/invalid highlighting. The highlight bar now goes on top of the
item-inner border so it will resize if there is an icon to the left.

BREAKING CHANGES:

Fixed typos in the input highlight variables:

- `$text-input-md-hightlight-color-valid` ->
`$text-input-md-highlight-color-valid`
- `$text-input-wp-hightlight-color-valid` ->
`$text-input-wp-highlight-color-valid`

Modified variables to turn on/off the highlight:

ios (defaults to false for all):

```
$text-input-ios-show-focus-highlight:      false !default;
$text-input-ios-show-valid-highlight:
$text-input-ios-show-focus-highlight !default;
$text-input-ios-show-invalid-highlight:
$text-input-ios-show-focus-highlight !default;
```

md (defaults to true for all):

```
$text-input-md-show-focus-highlight:        true !default;
$text-input-md-show-valid-highlight:
$text-input-md-show-focus-highlight !default;
$text-input-md-show-invalid-highlight:
$text-input-md-show-focus-highlight !default;
```

wp (defaults to true for all):

```
$text-input-wp-show-focus-highlight:        true !default;
$text-input-wp-show-valid-highlight:
$text-input-wp-show-focus-highlight !default;
$text-input-wp-show-invalid-highlight:
$text-input-wp-show-focus-highlight !default;
```

fixes #6449
references #5052
@brandyscarney
Copy link
Member

Thanks @Chuckv01, I fixed it in my latest commit so the highlight won't extend all the way to the left, unless it is the last in the list (which is the same behavior as the default border):

screen shot 2016-07-15 at 11 36 57 am

Also there are some breaking changes that will be in the beta 11 release (I fixed the typos where I was using hightlight 😳): 11a24b9

I'm still trying to find a way to make this easier to customize. I'm not sure about a success/valid/invalid color variable, @mnasyrov. Adding this to the color map would make it required, but it is something to consider so thanks for the suggestion. 😄

@jgw96 jgw96 removed this from the 2.0.0-beta.12 milestone Aug 9, 2016
@jabas06
Copy link

jabas06 commented Sep 30, 2016

The valid highlight should be shown only when the input has the touched state. Usually we display forms that contain initial data and the highlight should not be displayed at the begging.

Repro:
http://plnkr.co/edit/RaJiIDEZRXinNuQdGwZg?p=preview

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 4, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants