Needs review
Project:
Smart Date
Version:
4.2.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Nov 2024 at 17:32 UTC
Updated:
8 May 2026 at 13:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mandclu commentedWhat admin theme are you using?
Comment #3
mandclu commentedI have tested this in both Gin and Claro, and it works as expected. Unless I get detailed steps to reproduce on a fresh install or Drupal, I don't have a path forward.
Comment #4
gribnif commented1. Set up a test site using the evaluator guide: https://www.drupal.org/node/2997977

2. Install smart_date:
composer require 'drupal/smart_date:^4.2@beta'3. Create a new content type with a Smart Date Range.
4. Change the form display mode to Smart Date|Classic and move the date field to the top of the page. These are the options I used, to match my original site:
5. Add a new node using this content type. The default theme is Claro. This is what I see:

Comment #5
mandclu commentedAh OK, so the issue is specific to the Classic widget. That shouldn't be an overly difficult fix.
TBH I have been thinking of deprecating the Classic widget. Can I ask why you decided to use that one?
Comment #6
mandclu commentedComment #7
gribnif commentedI'm not entirely sure. I think it's simply because we've been using Smart Date since this was the only option. I just tried using Inline Range instead and, after some minor changes to the form_alter() hook we're using to set custom default values, I think it will work just fine--and it avoids the problem described above.
Comment #8
nicholassWe also ran into this bug, long time Smart Date users, and didn't even know new form display options existed. Seems like you could also fix the classic with a "position: relative" on the end date. We don't mind updating away from Classic, but probably lots of long term users of the module need notified to update their settings.
Comment #9
richarddavies commentedSame as previous comment, we're also long time Smart Date users who are having this issue with our Classic widgets (and were unaware there were newer options now.)
Can I ask why this 1+ year old issue hasn't been fixed yet if it's an easy fix? Presumably, you still support the Classic widget since it's still an option, right?
This seems to fix it for us, but there may be a better solution:
Comment #11
mandclu commentedThanks for the code suggestion! I rolled it into an MR. I would appreciate feedback from others who have experienced this issue
Comment #12
angel_devoeted commentedThe fix works as expected, but the selector
.smartdate--widget .time-end div.form-item:nth-child(2)has unnecessarily high specificity (0,4,1). Wouldn't a simpler selector like.smartdate--widget .time-endbe enough and more maintainable?