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

fix(ui5-datetime-picker): set min width #1698

Merged
merged 2 commits into from
May 29, 2020
Merged

Conversation

vladitasev
Copy link
Contributor

@vladitasev vladitasev commented May 28, 2020

The input length is not enough by several pixels and the text gets truncated/fully displayed whenever you focus/unfocus the component.

  • set min-width just enough to show the whole value
  • remove the fixed width from our test page

closes: #1696

@@ -0,0 +1,3 @@
:host .ui5-datepicker-input {
min-width: 14.5rem;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested and for long formats (format-pattern="long"), like "Aug 18, 2020, 10:32:30 AM" it might still not be enough,
14.75 to 15rem would be more safe:

Screenshot 2020-05-28 at 2 51 28 PM

Screenshot 2020-05-28 at 2 51 50 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I tested the same but with "Apr". After your comment I noticed that "Aug" and "Sep" are longer in terms of pixels than "Apr" due to the variable-width font, so I increased to 15rem.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes date-time picker width stand out when used alongside other inputs
for example:
image

@vladitasev vladitasev requested a review from ilhan007 May 28, 2020 12:11
@vladitasev vladitasev merged commit 7313838 into master May 29, 2020
@vladitasev vladitasev deleted the date-time-picker-min-width branch May 29, 2020 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ui5-datetimepicker: min width is not enough
3 participants