Skip to content

Conversation

@SubhikshaSf4851
Copy link
Contributor

@SubhikshaSf4851 SubhikshaSf4851 commented Mar 14, 2025

Root cause:

  • The maximum value of the stepper is set when the maximum value is greater than the minimum value. Since the minimum and maximum values are equal, the default value of 100 is applied, which results in the increment button being enabled.
  • The minimum value of the stepper is set when the minimum value is lesser than the maximum value. Since the maximum and minimum values are equal, the default value of 0 is applied, which results in the decrement button being enabled.

Description of Change:

  • I have changed the maximum value to be set by checking that the maximum value is greater than or equal to the minimum value of the stepper.
  • Similarly, for minimum value I have changed it by checking that the maximum value is lesser than or equal to the maximum value of the stepper.
  • I have checked the behavior in the native iOS UIStepper and observed that the increment and decrement buttons are disabled.

Tested the behaviour in the following platforms

  • Windows
  • Android
  • iOS
  • Mac

Issue Fixed:

Fixes: #28330

Output

Before Issue Fix After Issue Fix
Issue28330BeforeFix.mp4
Issue28330AfterFix.mp4

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Mar 14, 2025
@dotnet-policy-service
Copy link
Contributor

Hey there @SubhikshaSf4851! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Mar 14, 2025
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@SubhikshaSf4851 SubhikshaSf4851 marked this pull request as ready for review March 17, 2025 06:46
Copilot AI review requested due to automatic review settings March 17, 2025 06:46
@SubhikshaSf4851 SubhikshaSf4851 requested a review from a team as a code owner March 17, 2025 06:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a bug where the Stepper permitted incrementing beyond its maximum value when the minimum and maximum were equal.

  • Changed the validation logic in Stepper.cs to allow maximum and minimum to be equal instead of requiring strict inequality.
  • Added/updated test cases in both HostApp and Shared.Tests to verify that increment and decrement actions are disabled when the value equals the boundary.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/Controls/tests/TestCases.HostApp/Issues/Issue28330.cs Hosts a test page to visually check the stepper’s behavior on various platforms.
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28330.cs Contains automated UI tests ensuring the stepper does not increment or decrement when at its limits.
src/Controls/src/Core/Stepper/Stepper.cs Updates the validation conditions for Maximum and Minimum properties to allow equality.

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen changed the base branch from main to inflight/current March 18, 2025 18:22
@PureWeen PureWeen merged commit 49b462a into dotnet:inflight/current Mar 18, 2025
130 checks passed
PureWeen pushed a commit that referenced this pull request Mar 26, 2025
* Fix for stepper allows to increment value

* Updating naming concern

* Updates on minimum value and test case sample
PureWeen pushed a commit that referenced this pull request Mar 26, 2025
* Fix for stepper allows to increment value

* Updating naming concern

* Updates on minimum value and test case sample
github-actions bot pushed a commit that referenced this pull request Mar 27, 2025
* Fix for stepper allows to increment value

* Updating naming concern

* Updates on minimum value and test case sample
@github-actions github-actions bot locked and limited conversation to collaborators Apr 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-stepper Stepper community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stepper allows the value to increment past max when min, max, value set to 1.

3 participants