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

fix (input): ng-touched applied to ion-input on blur #12315

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/util/base-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ export class BaseInput<T> extends Ion implements CommonInput<T> {
this._form && this._form.unsetAsFocused(this);
this._setFocus(false);
this.ionBlur.emit(this);
this._onTouched && this._onTouched();
}
Copy link
Member

Choose a reason for hiding this comment

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

Thank you for submitting this PR.

It seems like this is only half of the fix. This will set ng-touched on blur, but it does not prevent touched from being applied on keyup (see #12102, #12700). I believe this same call also needs to be removed from onChange() on line 257.

I will need to ask around here about that, though.

Copy link
Author

@RodolfoSilva RodolfoSilva Aug 31, 2017

Choose a reason for hiding this comment

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

@kensodemann You're right.
If we look at the Angular implementation this is the expected behavior.
I'll change that.

Copy link
Author

@RodolfoSilva RodolfoSilva Aug 31, 2017

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

After reviewing this with @manucorporat, this change is a little deeper than this. As we have it coded right now, it will have a negative impact on checkboxes and a couple of other inputs. We discussed solutions, which I will try to get around to implementing over the weekend (easier to do than try to explain).

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @kensodemann 👍
I'll appreciate this fix.


/**
Expand Down