Allow setting disabled attribute on active-link #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm using a computed property to disable a child link. The computed property gets set asynchronously when the model loads. When that happens, I get the dreaded "You modified *** twice in a single render" deprecation warning:
I believe this is occurring because the child link 'disabled' class gets applied, then ember-cli-active-link-wrapper kicks in and applies the 'disabled' class to the wrapper element. I could of course set
{{active-link disabledClass=false}}
to prevent this; however, I need the wrapper element to have the 'disabled' class applied so that it disables the bootstrap nav item.This PR doesn't directly address the underlying issue of the double modification. All it does is allow for setting the disabled attribute on {{active-link}} itself rather than letting it be set dynamically based on the state of the children. Users can then manually disable the wrapper element.
For me, this fixes the double render issue because I can set my computed property directly on {{active-link}} so only one modification occurs during render.