How to stop an overlaid icon from intercepting clicks
Answer in brief
For a purely decorative overlay, use pointer-events: none so pointer input can reach the control beneath it. Keep the operation on a real, named control.
Test a calendar inside a date field
Place the decorative calendar over the trailing edge of a date input. Click the icon area, then the text area, and verify the expected input interaction in both places. If the calendar opens a separate picker, implement it as its own button.
Inspect the full overlay box
An icon container can stretch across an entire form row even when its drawing occupies only 16 pixels. Use the element inspector to highlight its bounds. Test clicking the field label and its clear button as well as the calendar area, especially after the row changes width.
Sources
- [1] pointer-events CSS property - CSS — MDN Web Docs, accessed November 23, 2026
Frequently asked questions
Will pointer-events remove an element from keyboard focus?
It changes pointer targeting. Manage keyboard interaction and semantic roles separately.