[dropzone] Address review comments on PR #4907#4918
Closed
Copilot wants to merge 15 commits into
Closed
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove stale dropzone-input.json (leftover from Input → HiddenInput rename) - Clarify onOpen JSDoc: only fires when no HiddenInput is present - CSS modules demo: replace hardcoded hex colors with design tokens, wrap hover in @media (hover: hover), fix :focus → :focus-visible, remove redundant .input class (HiddenInput handles its own visibility) - Tailwind demo: fix focus: → focus-visible: variants - public-types: fix Dropzone.Props/State → Dropzone.Root.Props/State - Update generated types.md for onOpen description change Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add './dropzone' to packages/react/package.json exports so @base-ui/react/dropzone resolves correctly - Fix non-breaking space in 'Base UI' brand name in dropzone/page.mdx and components/page.mdx (vale MuiBrandName rule) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use 'Base\u00a0UI' as a standalone keyword to match the convention of all other components, so docs:validate generates the correct non-breaking space in the component index (vale MuiBrandName rule). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- CSS modules demo: replace undefined --color-gray-* vars with direct oklch() values; set explicit color on container to prevent currentColor from inheriting red from the docs demo sentinel - Tailwind demo: replace gray-* with neutral-* (the project's defined color tokens) and blue-600/50/100 with available blue-500/blue-500/10 blue-500/15 tokens; add text-neutral-900 to the container for correct currentColor baseline Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…sions CSS module <p> elements inherit UA default margins and line-heights because all: revert-layer removes Tailwind preflight. Add explicit margin: 0 and line-height to match Tailwind's preflight behaviour. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Use 'Whether the component should ignore user interaction.' for disabled - Use 'Event handler called when...' for event handler props - Add docs link and 'Renders a <X> element.' to component JSDoc - Simplify children description to match Dialog/Collapsible patterns - Regenerate types.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The dragging state is driven purely by browser drag events — there's no meaningful external trigger to set it programmatically. onDraggingChange is sufficient for observing the state. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Matt <github@nospam.33m.co>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Matt <github@nospam.33m.co>
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
commit: |
Bundle size
PerformanceTotal duration: 1,055.31 ms ▼-456.33 ms(-30.2%) | Renders: 50 (+0) | Paint: 1,593.95 ms ▼-671.17 ms(-29.6%)
…and 5 more (+2 within noise) — details Check out the code infra dashboard for more information about this PR. |
…py restore, error codes
Copilot
AI
changed the title
[WIP] Fix code based on review comments
[dropzone] Address review comments on PR #4907
May 26, 2026
Member
|
Copilot opened the review PR against master instead of the fork. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Applies all feedback from the Copilot review on #4907. Changes are limited to the Dropzone component added in that PR.
Changes
Use
useButtoninstead of manual button semantics (DropzoneRoot.tsx): Removes hand-rolledrole="button",tabIndex,aria-disabled, andonKeyDown(Enter/Space) in favour of the shareduseButtonhook. Adds anativeButtonprop (defaulting tofalse) viaNonNativeButtonProps, consistent withSwitchRoot,CheckboxRoot, etc.getButtonPropsis passed as the last entry in theuseRenderElementprops array;buttonRefis included in the ref array.Guard
onDraggingChangeagainst no-op calls (DropzoneRoot.tsx):setDraggingpreviously calledonDraggingChangeunconditionally on everydragenter/dragleave, which fires multiple times as the pointer moves over children. Now uses a functional state updater to compare previous state and only fires the callback on an actual transition.Restore
HTMLInputElement.prototype.clickspy (DropzoneRoot.test.tsx): AddsinputClick.mockRestore()after the assertion; without it the spy wrapper leaks across tests since the suite usesvi.resetAllMocks()rather thanrestoreAllMocks().Fix Space key activation timing in tests (
DropzoneRoot.test.tsx):useButtonfires Space activation onkeyup(notkeydown) for non-native elements. Updated affected tests to usefireEvent.keyUpfor Space.Align error message and error code (
DropzoneRootContext.ts/error-codes.json): The test assertion and error-codes entry both used"DropzoneContext"while the thrown message already said"DropzoneRootContext". Both are updated to match.