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

[Bug]: Calendar icon in Datepicker input got displaced when providing the prop inline to true #16446

Closed
2 tasks done
jagathgj opened this issue May 13, 2024 · 4 comments · Fixed by #17144
Closed
2 tasks done
Labels
good first issue 👋 Used by GitHub to elevate contribution opportunities hacktoberfest See https://hacktoberfest.com/ role: dev 🤖 severity: 4 https://ibm.biz/carbon-severity type: bug 🐛 type: docs 📖

Comments

@jagathgj
Copy link

Package

@carbon/react

Browser

Chrome

Package version

1.57.0

React version

18

Description

When providing prop inline= true, the calendar icon which appears over date picker input got displaced over the calendar. This is because the svg(.cds--date-picker__icon) is in absolute position.

image

Reproduction/example

https://stackblitz.com/edit/github-y7mu2g?file=src%2FApp.jsx

Steps to reproduce

<DatePicker
            dateFormat="m/d/Y"
            datePickerType="single"
            onChange={() => {}}
            inline={true}
            altInputClass="invisible"
            allowInput={false}
          >
            <DatePickerInput
              id="datePickerinput"
              placeholder="mm/dd/yyyy"
              labelText="Date picker"
              hideLabel={true}
            />
</DatePicker>

Suggested Severity

None

Application/PAL

WxO

Code of Conduct

@tay1orjones
Copy link
Member

Hey, there was a similar issue opened recently, #16216

There I mentioned:

When inline was added it's only purpose was as a passthrough prop to flatpickr. There are no design specs for it and it wasn't really meant to be a fully supported functionality of the component.

The storybook documentation doesn't really reflect this though. It needs updated:

  • Remove it as a control from the controls pane
  • Leave it in the prop tables though
  • Update the comments on the prop and type to reflect that this feature is just a passthrough and doesn't have full support

Solving both this initial issue you pointed out, as well as the documentation items are great candidates for the community to fix/implement.

I think we can leave this issue open for making these updates to documentation

@tay1orjones
Copy link
Member

@carbon-design-system/design are there any outstanding specs for this? should there be? If we're interested in fully supporting this feature we could take a look at how to accomplish this.

@laurenmrice
Copy link
Member

laurenmrice commented May 20, 2024

@tay1orjones I agree with your response above. If we are not fully supporting this because it's a passthrough prop to flatpicker, the prop should be removed from the control pane and only listed in the prop tables.

Since this use case of using an inline date picker input (instead of our default input with a background) is not a frequent need or ask from our community within and outside of IBM, I don't feel we need to fully support this feature and it can continue to be used as a passthrough prop to flatpicker.

@NabeelAyubee
Copy link
Contributor

NabeelAyubee commented Aug 12, 2024

Hi, I have tried to resolved the above issue. I have updated the CSS which is causing calendar icon alignment issue. I have added the story for inline true props.
Tested in local. It is working as expected.
Please review my PR and let me know if there's anything I missed.
Link: #17144

PS: My previous PR had some issue due to unwanted merges so closed it.

github-merge-queue bot pushed a commit that referenced this issue Aug 19, 2024
* fix(calendar): fix calendar icon CSS issue #16446

* fix(calendar): removed date picker inline story  #16446
@github-project-automation github-project-automation bot moved this from ⏱ Backlog to ✅ Done in Design System Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue 👋 Used by GitHub to elevate contribution opportunities hacktoberfest See https://hacktoberfest.com/ role: dev 🤖 severity: 4 https://ibm.biz/carbon-severity type: bug 🐛 type: docs 📖
Projects
Archived in project
5 participants