-
Notifications
You must be signed in to change notification settings - Fork 375
Description
In core, because of the way we want to manage the spacing for the animation of the progress indicator and button text in non-plain buttons between the in progress and not in progress states, we have a .pf-m-progress class that changes the padding a bit to allow for a smooth animation. From there, the progress button then gets .pf-m-in-progress dynamically to toggle between in progress and not in progress. The plain button doesn't have any sort of spacing or button text animation, so it only needs the .pf-m-in-progress class. Adding .pf-m-progress applies the animation padding to the plain button, which doesn't look correct.
Currently in the react component, a plain progress button requires either of the following when it is not yet in the "in progress" (isLoading) state, otherwise the styles.modifiers.progress class is added, which applies the wrong padding.
- if the icon is passed as
children, it needsisLoading === null- setting it tofalseaddsstyles.modifiers.progress- seems like in apps there will likely be a bool state var that manages the progress state of whatever's going on in the page (eg,
dataRefreshing), and it would be great just to useisLoading={dataRefreshing}, but that doesn't work if{dataRefreshing}isfalse.
- seems like in apps there will likely be a bool state var that manages the progress state of whatever's going on in the page (eg,
- for the icon passed as the
iconprop, and forchildren === null
I think we can address this one of a couple of ways:
- address this in the CSS, and disable any of the
.pf-m-progressstyles from applying to to the plain button. Then theisLoadingprop on the<Button>component can work the same between plain and non-plain buttons. - Update this line
isLoading !== null && children !== null && styles.modifiers.progress,
to something likeisLoading !== null && variant !== ButtonVariant.plain && styles.modifiers.progress,
Or maybe some other way? I see pros/cons to either approach, curious your thoughts @tlabaj @nicolethoen, also @thatblindgeye since you worked on the inline progress button (which needs .pf-m-progress)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status