fohrloop / dash-uploader

The alternative upload component for python Dash applications.
MIT License
144 stars 30 forks source link

handle React component classes correctly #60

Closed fohrloop closed 2 years ago

fohrloop commented 2 years ago

The upload component (src\lib\components\Upload_ReactComponent.react.js) seems to select the "most appropriate css class" by this logic:

        const getClass = () => {
            if (this.props.disabledInput) {
                return this.props.disableClass;
            } else if (this.state.isHovered) {
                return this.props.hoveredClass;
            } else if (this.state.isUploading) {
                return this.props.uploadingClass;
            } else if (this.state.isComplete) {
                return this.props.completeClass;
            } else if (this.state.isPaused) {
                return this.props.completeClass;
            }
            return this.props.className

        }

in addition to the typo in "isPaused", the class should be the union of all classes. For example, if the state is uploading, and mouse is on the component (hovered), the class should be this.props.uploadingClass this.props.hoveredClass (class strings one after another, separated with space(s).