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

disabled inputs with a formControlName are still focusable #10155

Closed
jgw96 opened this issue Jan 24, 2017 · 3 comments · Fixed by #10214
Closed

disabled inputs with a formControlName are still focusable #10155

jgw96 opened this issue Jan 24, 2017 · 3 comments · Fixed by #10214
Assignees
Milestone

Comments

@jgw96
Copy link
Contributor

jgw96 commented Jan 24, 2017

Ionic version: (check one with "x")
[ ] 1.x
[x ] 2.x

I'm submitting a ... (check one with "x")
[x ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:

On this e2e http://localhost:8000/dist/e2e/input/form-inputs/ if you tap a disabled input the input will act like it is focused (will cause the page to scroll) even though its disabled. The reason for this is that when disabling with angular forms the ion-input does not get the disabled attribute so our css which targets using the disabled attribute does not get applied.

Steps to reproduce:

@brandyscarney
Copy link
Member

I think the solution to this should be adding a class to the ion-input:

  set disabled(val: boolean) {
    this.setDisabled(this._disabled = isTrueProperty(val));
    this.setElementClass('text-input-disabled', this._disabled);
  }

cc @adamdbradley

@jgw96 jgw96 added the v2 label Jan 24, 2017
@brandyscarney brandyscarney self-assigned this Jan 24, 2017
@brandyscarney
Copy link
Member

Note to self: pass disabled attribute to ion-input as well.

@adamdbradley adamdbradley added this to the 2.0.1 milestone Jan 27, 2017
brandyscarney added a commit that referenced this issue Jan 27, 2017
Adds the disabled attribute to the parent input/textarea, also fixes
where disabled textareas were focusable regardless of where disabled
was set

fixes #10155
jgw96 pushed a commit that referenced this issue Jan 27, 2017
Adds the disabled attribute to the parent input/textarea, also fixes
where disabled textareas were focusable regardless of where disabled
was set

fixes #10155
@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

Successfully merging a pull request may close this issue.

3 participants