Chrome 中日期类型输入元素的清除按钮在哪里?

Ian*_*nah 7 html google-chrome date input

直到上周四,日期类型的输入元素旁边都曾经有一个清除按钮(一个十字或“x”)。

现在它看起来像这样:

在此处输入图片说明

有谁知道发生了什么变化?我怎样才能恢复清除按钮?

我们使用 angular 和 Chrome 作为浏览器。

下面的 HTML 代码显示了问题(使用 Chrome 时):

<label for="birthdaytime">Birthday (date and time):</label> <input type="datetime-local" id="birthdaytime" name="birthdaytime">
Run Code Online (Sandbox Code Playgroud)

gea*_*ded 9

它被报告为一个错误:

https://bugs.chromium.org/p/chromium/issues/detail?id=1087490#c1

https://bugs.chromium.org/p/chromium/issues/detail?id=1087501

错误讨论中的某人提出了一种解决方法:添加一个按钮来清除日期本地元素值:

<input id=el type=datetime-local value="2025-07-01T12:44">
<button onclick="javascript:el.value=''">X</button>
Run Code Online (Sandbox Code Playgroud)

https://jsfiddle.net/cxpt4r8b/