Adding placeholder support

Created on 28 February 2024, 10 months ago
Updated 29 February 2024, 10 months ago

Problem/Motivation

As mentioned in this issue: https://www.drupal.org/project/date_popup/issues/3181598 🐛 Placeholder doesn't show Needs work the module does not support placeholder management on date type inputs when a placeholder is defined in the exposed filter.

Proposed resolution

The proposed solution is to replace date fields with text fields when no value is submitted. This displays the placeholder authorized by the text field.

When a field is clicked, a javascript action changes the field type to date and automatically opens the html5 datepicker.

User interface changes

Changing from a text field to a date field can have consequences on your site's css, notably on the position of the datepicker, which is opened automatically.

Feature request
Status

Needs work

Version

2.0

Component

Code

Created by

🇷🇪Réunion morgannc La Réunion

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @morgannc
  • Open on Drupal.org →
    Core: 10.2.1 + Environment: PHP 8.1 & MySQL 8
    last update 10 months ago
    Waiting for branch to pass
  • 🇷🇪Réunion morgannc La Réunion

    I'm taking advantage of this issue to run drupal/coder over the source code and add a README.

  • Open on Drupal.org →
    Core: 10.2.1 + Environment: PHP 8.1 & MySQL 8
    last update 10 months ago
    Waiting for branch to pass
  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Thanks, can we split the PHPCS and README changes to a different issue?

    What's the use case here?

  • Status changed to Needs work 10 months ago
  • 🇷🇪Réunion morgannc La Réunion

    Phpcs and Drupal standards were correctly applied, so no change there. I mainly tested the new code implemented for compatibility.

    For the README, I think it's a good idea to include one, given the paradigm shift in text/date input (to explain how the module works and behaves).

    I'm switching the issue back to "Need Work". After testing on mobile, the datepicker doesn't open automatically, so I need to find a way to force it to open in javascript so that it behaves like a date input.

Production build 0.71.5 2024