-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Introduce the concept of state transitions in Blazor to allow for e.g. animations #10389
Copy link
Copy link
Open
Open
Copy link
Labels
Priority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releaseaffected-fewThis issue impacts only small number of customersThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis 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-builtin-componentsFeatures related to the built in components we ship or could ship in the futureFeatures related to the built in components we ship or could ship in the futureneeds-prototypeon-roadmapListed on the current release roadmapListed on the current release roadmapseverity-majorThis label is used by an internal toolThis label is used by an internal tool
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
Priority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releaseaffected-fewThis issue impacts only small number of customersThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis 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-builtin-componentsFeatures related to the built in components we ship or could ship in the futureFeatures related to the built in components we ship or could ship in the futureneeds-prototypeon-roadmapListed on the current release roadmapListed on the current release roadmapseverity-majorThis label is used by an internal toolThis label is used by an internal tool
Is your feature request related to a problem? Please describe.
Following on from my StackOverflow question...
In my Blazor components I often render components based on either a conditional statement, e.g.
Or from a loop, e.g.
When I change the state I'd like to animate the state transition so that the components fade in/out. In the examples above that might happen when IsCustomer changes, or when a record is added or removed from the SalesOrders collection.
Animating adding a component can be done with CSS, but I think that animating the removal of a component will be impossible because it simply doesn't exist in the next render, so there's nothing to hang the animation onto?
Describe the solution you'd like
In React there used to be a series of attributes related to state transitions, which now seem to have been replaced by react-transition-group. That looks like a big hammer for what seems like a fairly small nut.
Ideally I'd favour something really simple to use, like having an
on-removal-classattribute for the name of a CSS class that's then added to the component, and allowed to complete, when the item is identified for removal from the render tree. That seems like it may be possible, because if I understand Blazor correctly the new and old render trees are diff'd to work out what parts to re-render?There are potentially lots of other things you might want to happen in a state transition too, and no-doubt some that can't be handled with CSS alone, but I think the animation side of things is fairly important to aid users in understanding the consequences of a particular UI interaction?