DateTimePicker width inline works, css class does not

1 Answer 48 Views
Date/Time Pickers
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Morten asked on 10 Aug 2024, 11:35 AM

I want some of my date time pickers to have a width of 140px.

 https://dojo.telerik.com/@mortenma71/eSAhOyaN/9

It works when I set the width using inline style:
<input id="datepicker" value="10/10/2011" style="width:140px;" />

It doesn't work when I set the width using a CSS class.

Without !important the CSS class seem to have no effect:
<style>.width-140 { width: 140px; }</style>
<input id="datepicker2" value="10/10/2011" class="width-140" />

With !important the CSS class effects the width, however the svg-picker-icon doesn't show:
<style>.width-140-important { width: 140px !important; }</style>
<input id="datepicker3" value="10/10/2011" class="width-140-important" />

I only observed the problem now; I'm sure it worked in an earlier kendo/CSS version.

How can I set the width using a CSS class and retain the svg-picker icon?

/Morten

Morten
Top achievements
Rank 2
Iron
Iron
Veteran
commented on 10 Aug 2024, 12:23 PM | edited

It appears that changing the CSS definition from: 

.width-140-important { width: 140px !important; }

to:

.width-140-important { max-width: 140px !important; }


works!

https://dojo.telerik.com/@mortenma71/eSAhOyaN/10

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 14 Aug 2024, 01:27 PM

Hello, Morten,

The behaviour is due to a known bug described here. The fix didn't make if for the last release, but you can use the workaround you mentioned in your last reply until our next release.

Let me know if you have any further questions.

Regards,
Martin
Progress Telerik

Do you have a stake in the designеr-developer collaboration process? If so, take our survey to share your perspective and become part of this global research. You’ll be among the first to know once the results are out.
-> Start The State of Designer-Developer Collaboration Survey 2024

Tags
Date/Time Pickers
Asked by
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Martin
Telerik team
Share this question
or