Skip to content

Picker adds unexpected margin when label positioned on the side #2961

Open
@audknu

Description

@audknu

🐛 Bug Report

When a spectrum picker has a label, an unexpected margin is added to the right of the picker. This is not ideal for a picker that is end-aligned.

🤔 Expected Behavior

Should be able to remove this default margin without needing to define an external label. Using width = 'unset' should remove this margin like is done for the top label position.
Screen Shot 2022-03-10 at 2 41 51 PM

😯 Current Behavior

Unexpected end margin.
Screen Shot 2022-03-10 at 3 10 31 PM

💁 Possible Solution

  • Ideal solution is for the picker to remove this margin when width = 'unset' for all label postions.
  • Use an external label. Can confirm this removes the unwanted end margin, but the picker adds its own internal empty label, which is not ideal:
    external_label_html

🔦 Context

Not able to end align the picker when the label is positioned on the side:
Expected:
Screen Shot 2022-03-15 at 8 24 51 AM

Current:
Screen Shot 2022-03-15 at 8 29 20 AM

💻 Code Sample

Codesandbox

🌍 Your Environment

Software Version(s)
react-spectrum 3.14.1, 3.15.1, 3.16.4
Browser Chrome
Operating System MacOS

🧢 Your Company/Team

Adobe Admin Console

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is neededrsp:Picker

    Type

    No type

    Projects

    • Status

      🗑 Deferred

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions