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

range field now correctly takes 0 into account #4822

Merged
merged 1 commit into from
Dec 17, 2024
Merged

Conversation

ETLaurent
Copy link
Contributor

@ETLaurent ETLaurent commented Dec 16, 2024

Summary

Fix range component to make it take into account the 0 value.

What are the specific steps to test this change?

In a piece or widget, add the following field:

rangeRequired: {
        label: 'range',
        type: 'range',
        min: -70,
        max: 70,
        def: 5,
        required: true
}

Edit the piece/widget and set the range value to 0.
Save
Re-open, the range field should be set to 0, not set to the default value.

What kind of change does this PR introduce?

(Check at least one)

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated -> https://github.com/apostrophecms/testbed/pull/313

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

Copy link

linear bot commented Dec 16, 2024

@ETLaurent ETLaurent requested a review from boutell December 16, 2024 18:41
@ETLaurent ETLaurent marked this pull request as ready for review December 16, 2024 18:41
@ETLaurent ETLaurent added don't merge yet This PR is meant to be merged, but not right away and removed don't merge yet This PR is meant to be merged, but not right away labels Dec 17, 2024
@ETLaurent ETLaurent merged commit 1038a65 into main Dec 17, 2024
9 checks passed
@ETLaurent ETLaurent deleted the pro-6866-range branch December 17, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants