Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: value handling of DynamicUnitInputNumberWithSlider #2730

Merged

Commits on Oct 2, 2024

  1. fix: value handling of DynamicUnitInputNumberWithSlider (#2730)

    **Changes:**
    
    This PR fixes and enhances the `DynamicUnitInputNumberWithSlider` component by improving its value handling:
    
    1. Update Input behavior (fix bug and improve UX):
      - set the controllable value always.
    1. Updated slider behavior:
       - Set value to 0 and disable slider and hide tooltip when min value exceeds max value
      - Added `filterOutInvalidMarks` function to remove marks that fall outside the valid range(min~ max).
    1. Removed dependency on external `isMinOversMaxValue` function from `ResourceAllocationFormItems`
    
    Addtionally this PR adds new stories:
       - "Greater min than max" to demonstrate behavior when min value exceeds max value
       - "Extra marks" to show custom marks on the slider
       - "Extra marks with greater min than max" combining both scenarios
    
    **Rationale:**
    
    These changes improve the component's robustness and flexibility, handling edge cases and providing better visual feedback to users.
    
    **Effects:**
    
    - Users will see more consistent behavior when min/max values are set incorrectly
    - Developers can now add custom marks to the slider and test various scenarios using the new stories
    yomybaby committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    f23da9d View commit details
    Browse the repository at this point in the history