Make WordPress Core

Changeset 59114


Ignore:
Timestamp:
09/29/2024 10:47:03 PM (7 months ago)
Author:
SergeyBiryukov
Message:

Date/Time: Use numeric input for touch_time() fields.

This aims to make it easier to enter digits in datetime text fields on mobile devices, instead of opening the full keyboard.

Follow-up to [43], [1506], [2998], [3648], [6078], [6989], [7285], [7338], [20168], [20217], [28730], [32945], [49283].

Props sabernhardt.
Fixes #62109.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/template.php

    r58419 r59114  
    851851        /* translators: Hidden accessibility text. */
    852852        __( 'Day' ) .
    853     '</span><input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
     853    '</span><input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" inputmode="numeric" /></label>';
    854854    $year = '<label><span class="screen-reader-text">' .
    855855        /* translators: Hidden accessibility text. */
    856856        __( 'Year' ) .
    857     '</span><input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
     857    '</span><input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" class="form-required" inputmode="numeric" /></label>';
    858858    $hour = '<label><span class="screen-reader-text">' .
    859859        /* translators: Hidden accessibility text. */
    860860        __( 'Hour' ) .
    861     '</span><input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
     861    '</span><input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" inputmode="numeric" /></label>';
    862862    $minute = '<label><span class="screen-reader-text">' .
    863863        /* translators: Hidden accessibility text. */
    864864        __( 'Minute' ) .
    865     '</span><input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
     865    '</span><input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" inputmode="numeric" /></label>';
    866866
    867867    echo '<div class="timestamp-wrap">';
Note: See TracChangeset for help on using the changeset viewer.