question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Select cannot be disabled by default

See original GitHub issue

If the variable ngDisabled is set to is initialized with a truthy value, the select is not disabled. However, if it is initialized to a falsy value, then changed to a truthy value (after some time delay, as changes made too quickly are also not registered), it works as it should.

Example:

<select chosen ng-disabled="selectDisabled"></select>

Doesn’t work:

$scope.selectDisabled=true;

This works:

$scope.selectDisabled=false;

$timeout(function(){
      $scope.selectDisabled=true;
}, 1000);

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kbhagchandanicommented, Jun 19, 2015

As pointed by @Odi55555 i have modified the stopLoading function and this has resolved the issue

stopLoading = function() {
    var disable=(attr.ngDisabled)?scope.$eval(attr.ngDisabled):false;
    return element.removeClass('loading').attr('disabled', disable).trigger('chosen:updated');
};

However original source code is in coffeescript and i am not very much familiar to that please adopt the changes.

0reactions
Sunnyson303commented, May 5, 2016

@azuax thx

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to show disable HTML select option in by default?
So i want to set "Choose Tagging" as by default and also want to disable it from selection. Is it a way to...
Read more >
Ng Select Disabled - StackBlitz
Starter project for Angular apps that exports to the Angular CLI.
Read more >
HTML DOM Select disabled Property - W3Schools
A disabled element is unusable and un-clickable. Disabled elements are usually rendered in gray by default in browsers. This property reflects the HTML ......
Read more >
How to disable select till a value is given in previous sele
Note: Disabled allows for the select to exist but remain unclickable till the value changes to false. Resources (screenshots, code snippets etc.) enter...
Read more >
Blade disable selected box option - Laracasts
Selected and disabled is a non-sense. Remove the disabled and validate the field as required. But you can always do. Copy Code {!!...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found