-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
Pillar: Complete Blazor WebPriority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releasearea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsbreaking-changeThis issue / pr will introduce a breaking change, when resolved / merged.This issue / pr will introduce a breaking change, when resolved / merged.copilot-candidateenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-enhanced-navigation
Milestone
Description
I was trying out data-permanent and was confused for a while because it seemed not to work. Then I tried moving it to an ancestor element and it did work.
Repro
- Start with
<div id='myelem' data-permanent></div> - Use JS to mutate it in some way (e.g.,
document.getElementById('myelem').classList.toggle('expand')) - Perform an enhanced nav that returns equivalent content (i.e.,
<div id='myelem' data-permanent></div>)
Expected: The expand class should be retained
Actual: It is not
However if you replace the markup with <div data-permanent><div id='myelem'></div></div> then the class is retained
I guess diffing only uses data-permanent to decide whether to recurse into the element, but I think it should also use it to decide whether to synchronize the attributes on that element.
AslanAmca and alexgilevich
Metadata
Metadata
Assignees
Labels
Pillar: Complete Blazor WebPriority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releasearea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsbreaking-changeThis issue / pr will introduce a breaking change, when resolved / merged.This issue / pr will introduce a breaking change, when resolved / merged.copilot-candidateenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-enhanced-navigation