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

If ng-disabled is true. Input field is disabled but buttons are not #73

Closed
cgarveyie opened this issue Apr 3, 2020 · 4 comments
Closed

Comments

@cgarveyie
Copy link

cgarveyie commented Apr 3, 2020

Pretty much as the title suggests. For a picker with the calendarWidget enabled, only the input field is disabled. The open widget and clear buttons are not disabled

hexadecy added a commit that referenced this issue Apr 6, 2020
@hexadecy
Copy link

hexadecy commented Apr 6, 2020

Can you check it works? with version 1.19.4

@cgarveyie
Copy link
Author

cgarveyie commented Apr 6, 2020

Hi hexadecy and thanks for looking at this so quickly.

It works if you pass in "true" or "false" as a string value for ngDisabled but if you pass in an expression which resolves to true or false it doesn't work.

My own use case is that I want to dynamically enable/disable the date time picker depending on whether or not an event is being scheduled so for me this solution is incomplete.
e.g.
ngDisabled = "vm.eventData.isScheduled !== 'scheduled'"
resolves to false unless the isScheduled SELECT list is scheduled.

I played with it a bit as follows:

// Evaluate the value
var isDisabled = scope.$eval(attrs.ngDisabled);

// Keep it DRY
(isDisabled ? 'disabled ' : '')

This fixes the evaluation issue but unlike the inputfield, the buttons aren't updated if the expression value changes.

hexadecy added a commit that referenced this issue Apr 8, 2020
@hexadecy
Copy link

hexadecy commented Apr 9, 2020

Sorry, I have no idea right now how to make it dynamic.

@hexadecy
Copy link

hexadecy commented Sep 4, 2021

Stalled issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants