disabledClass of link-to component might not work, depending on attributes order
See original GitHub issuelink-to component has not documented property disabledClass which is supposed to change class of disabled link. I see that it’s marked as private but sometimes this feature is needed. When I set disabledClass to some value, I expect link to have that class. But following code does not work as expected (expected link to have class some-class, in fact it has disabled class and not some-class):
{{#link-to 'parent' tagName='div' class='item' disabled=true disabledClass='some-class'}}
<div class="header">Menu Item</div>
<div class="menu">
{{link-to 'Sub-menu Item 1 ' 'parent.child-1' class='item'}}
{{link-to 'Sub-menu Item 2 ' 'parent.child-2' class='item'}}
</div>
{{/link-to}}
And this code works just fine:
{{#link-to 'parent' tagName='div' class='item' disabledClass='some-class' disabled=true}}
<div class="header">Menu Item</div>
<div class="menu">
{{link-to 'Sub-menu Item 1 ' 'parent.child-1' class='item'}}
{{link-to 'Sub-menu Item 2 ' 'parent.child-2' class='item'}}
</div>
{{/link-to}}
I think it works this way:
classNameBindingscontainsdisableddisabledis defined as a computed property without dependent keys and has a setter which returnsdisabledClass- In first example setter of
disabledproperty is called beforedisabledClassis changed from default valuedisabledtosome-class
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How to disable a vuejs router-link? - Stack Overflow
There is nothing built in, and probably won't ever be. ... the disabled attribute, but one trick would be using tag="button" in order...
Read more >How to Disable Links | CSS-Tricks
There is a problem though: there is no real way to disable an <a> link (with a valid href attribute) in HTML. Not...
Read more >Deprecations Added in Ember 3.x
The deprecated copy function now handles array copies directly, no longer delegating to NativeArray.copy . With this deprecation, NativeArray no longer inherits ...
Read more >disabled - CSS: Cascading Style Sheets - MDN Web Docs
The :disabled CSS pseudo-class represents any disabled element. An element is disabled if it can't be activated (selected, clicked on, ...
Read more >doc - intercooler.js - Simple AJAX using HTML attributes
Intercooler depends on JQuery, version 1.10.0 or higher, and is ... The attributes above are defined in terms of ic-src , you will...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@sandstrom - I just tested this on Ember 3.28.1 and the issue is still there so please do not close the issue.
I’m doing some issue gardening 🌱🌿 🌷 and came upon this issue. Since it’s quite old I just wanted to ask if this is still relevant? If it isn’t, maybe we can close this issue?
By closing some old issues we reduce the list of open issues to a more manageable set.