Skip to content

Conversation

@mj12albert
Copy link
Member

Fixes #3908

@mj12albert mj12albert added component: slider Changes related to the slider component. component: number field Changes related to the number field component. labels Feb 1, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 1, 2026

commit: 1738a83

@mui-bot
Copy link

mui-bot commented Feb 1, 2026

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+12B(0.00%) 🔺+5B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@netlify
Copy link

netlify bot commented Feb 1, 2026

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 1738a83
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6980a7a345c0f100078b90e0
😎 Deploy Preview https://deploy-preview-3909--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mj12albert mj12albert force-pushed the fix/missing-field-state-data-attrs branch from 7e754c7 to 512d843 Compare February 2, 2026 06:59
@mj12albert mj12albert changed the title Fix missing field state data attrs [number field][slider] Fix missing field state data attributes Feb 2, 2026
@mj12albert mj12albert added the type: bug It doesn't behave as expected. label Feb 2, 2026
@mj12albert mj12albert marked this pull request as ready for review February 2, 2026 07:06
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 2, 2026

Greptile Overview

Greptile Summary

Fixed missing field state data attributes (data-valid and data-invalid) on NumberField and Slider root components by adding fieldValidityMapping to their state attribute mappings. This ensures consistency with other field components like Switch, Radio, and Combobox that already include these attributes.

  • Added fieldValidityMapping spread to packages/react/src/number-field/utils/stateAttributesMapping.ts
  • Added fieldValidityMapping spread to packages/react/src/slider/root/stateAttributesMapping.ts
  • Added comprehensive test coverage verifying the attributes appear correctly on root and child elements during validation state changes

Confidence Score: 5/5

  • Safe to merge - straightforward bug fix with comprehensive test coverage
  • The changes are minimal, follow established patterns used in other components (Switch, Radio, Combobox), and include thorough test coverage that validates the fix works correctly
  • No files require special attention

Important Files Changed

Filename Overview
packages/react/src/number-field/utils/stateAttributesMapping.ts Added fieldValidityMapping to expose valid/invalid state attributes on NumberField root
packages/react/src/slider/root/stateAttributesMapping.ts Added fieldValidityMapping to expose valid/invalid state attributes on Slider root
packages/react/src/number-field/root/NumberFieldRoot.test.tsx Added tests verifying data-valid and data-invalid attributes on root and input elements
packages/react/src/slider/root/SliderRoot.test.tsx Added tests verifying data-valid and data-invalid attributes on root and thumb elements

@mj12albert mj12albert merged commit 7195d2e into mui:master Feb 2, 2026
23 checks passed
@mj12albert mj12albert deleted the fix/missing-field-state-data-attrs branch February 2, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: number field Changes related to the number field component. component: slider Changes related to the slider component. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NumberField not adding data-invalid attribute

3 participants