Open kaiortmanns opened 3 years ago
ProgressBar does not show fast updates correctly like showing download progress of a file.
Show progress according to updates.
Progress updates are manipulated by a CSS transition which is why fast updates donΒ΄t get reflected correctly.
Add option to turn off CSS transition.
Showing progress for file downloads with fast progress updates.
import { darkTheme, ProgressBar, Provider } from '@adobe/react-spectrum' import React, { PureComponent } from 'react' type ProgressAppProps = {} type ProgressAppState = { value: number } export default class ProgressApp extends PureComponent<ProgressAppProps, ProgressAppState> { constructor(props: ProgressAppProps) { super(props) this.state = { value: 0, } this.updateValue() } updateValue(): void { const { value } = this.state if (value < 100) { this.setState({ value: value + 1 }) setTimeout(() => { this.updateValue() }, 20) } } render(): JSX.Element { const { value } = this.state return ( <Provider theme={darkTheme} height='100%'> <ProgressBar label='test' value={value} /> </Provider> ) } }
Adobe
NA
I wonder if we could automatically disable the transition if updates are occurring quickly?
π Bug Report
ProgressBar does not show fast updates correctly like showing download progress of a file.
π€ Expected Behavior
Show progress according to updates.
π― Current Behavior
Progress updates are manipulated by a CSS transition which is why fast updates donΒ΄t get reflected correctly.
π Possible Solution
Add option to turn off CSS transition.
π¦ Context
Showing progress for file downloads with fast progress updates.
π» Code Sample
π Your Environment
π§’ Your Company/Team
Adobe
π· Tracking Issue (optional)
NA