Skip to content

Headless: prop getters handle overrides inconsistently (getDropzoneProps drops them, getInputProps clobbers style) #341

Description

@BSalaeddin

The three prop getters from useUpupUpload treat their overrides argument differently (3.1.0, @upupjs/react/dist/index.cjs):

  • getRootProps(overrides) — spreads ...overrides first, then sets role/aria after. Styling overrides work.
  • getDropzoneProps(overrides) — composes the four drag/drop handlers from overrides but returns the object without spreading the rest. className, style, or anything else passed in is silently dropped.
  • getInputProps(overrides) — spreads ...overrides first, but then sets style: { display: 'none' } after the spread, so a style override is always clobbered.

Our first headless integration passed className through getDropzoneProps and lost half an hour to the styling silently going nowhere before we read the dist source.

It'd be good if all three getters followed the same contract (spread overrides, compose getter-owned handlers, and document any keys the getter must own). If display: none on the input is load-bearing, that's fine — but then dropping/clobbering should at least be documented on the headless guide's prop-getter section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions