About this article
This article was created using an automated generation workflow powered by generative AI. We verified official documentation and fixed educational materials, and organized the operational and technical constraints.Verification status: 📘 Official information and implementation cross-checked. Browser physical devices not verified.
When writing a request reason, you may sometimes want to view input examples briefly. We will test whether the supplementary display opens and whether the draft content is preserved.
- Key terms to know first
- Thinking with a process flowchart
- Operating the live demo
- Key points of the code
- When using it at work
- Test whether the content being entered is lost
- Roles of popovers and modals
- Design for retaining input values
- Troubleshooting when not displayed
- Verification Scope
- References
- GitHub sample
Key terms to know first
A popoveris a small supplementary display that appears on top of the screen.
Light dismissis a mechanism where the element closes when interacting with the outside.
Thinking with a process flowchart
Read from left to right. Anticipate how changing the supplementary display affects the continuation of input.
flowchart LR
A["編集中の欄"] --> B["補足の表示"] --> C["入力の継続"]
Operating the live demo
Type characters into the input field. Open the input example and click outside of it.
How to interpret the results
The input content remains even after the popover closes.
Input can be resumed even after closing the input example. For short supplementary text that you want users to read while typing, it is easy to distinguish from confirmation components that lock the screen.
Key points of the code
Open an element with a popover attached using a popovertarget button, then click outside.
The implementation can be checked in the "Implementation Code" section of the demo screen.
When using it at work
Suitable for short input examples. Essential information should also remain in the main body text.
Test whether the content being entered is lost
Pressing the execute button displays a text input field and an input example button. Type equipment A in the input field, then press the input example. Expected behavior: A supplementary note such as Example: Return equipment A. is displayed. Next, click outside the popover to close it. Check if equipment A written in the input field remains. Then try adding the word return. The result field shows the content retrieved by the input event, allowing you to verify whether input could be continued.
Next, try opening the supplementary note and pressing Esc to close it. Compare whether the input content is maintained in the same way as when closed by clicking. A popover is not a component that blocks operations behind it, but with the auto setting used here, clicking the input field outside may close the note. There is no guarantee that you can always continue typing while the supplementary note is displayed. The core focus of this learning material is ensuring that the state of ongoing input is not erased when closed.
Roles of popovers and modals
Supplementary information is suitable for presenting content that you want to reference when needed, such as input examples or terminology explanations. In scenarios where confirmation is mandatory to proceed with an operation, using a confirmation screen may better fit the objective. The Popover API allows you to add the popover attribute to the element to be displayed and specify the target using popovertarget on the operation button. In this implementation, the ID of the supplementary element is set to hint, and the button also targets hint. It is crucial that the target IDs match.
An auto-state popover can be closed by clicking outside or pressing Esc. The open element is displayed in a layer above the normal layout. However, it is not automatically positioned right next to the input field. CSS for adjusting the display position must be provided separately. What can be learned from the tutorial code is the processing of opening/closing and input, and the visual appearance across different devices has not been verified.
Design for retaining input values
The implementation sets a supplementary string and passes the value to the result field via oninput in the input field. The logic for opening and closing the supplementary note does not include an operation to clear input values. Decoupling the supplementary display state from the input data in this manner makes the screen behavior easier to understand. Ensure that simply closing the supplementary note does not initialize the application content. However, re-pressing the execute button recreates the screen components, so this is not a feature for saving previous input values. Retention after browser reload is also not handled.
In actual operations, separate input validation determines whether to accept values that do not follow input examples. Supplementary displays are intended to aid user understanding and are not meant to hide mandatory conditions. For instance, maximum character limits and required inputs should be stated in a location visible without opening the supplementary note. Input examples should use fictional values, and there is no need to display the user's actual information directly in the supplementary note.
Troubleshooting when not displayed
If pressing the button does nothing, check whether the target ID and popovertarget match. Also check if the browser supports the Popover API. For environments that do not support it, consider a fallback where the supplementary text is displayed as standard body text. If the supplementary note closes immediately, check the outside-click handling of auto and the behavior of opening another popover. Separately test whether the meaning of the supplementary note is conveyed via keyboard operation or screen readers, and whether the display position obscures the operation controls.
Creating a supplementary display does not require sending business data to a server. This learning material also contains no transmission processing. Enter fictional application reasons in the public demo, and do not input actual business information or personal names.
Verification Scope
Target: HTML Popover API (auto). Static verification of MDN auto/light dismiss/top layer, fixed HTML popover and popovertarget, and input events. Real browser operation not executed. Browser compatibility, display, accessibility, and Mermaid rendering unconfirmed.
References
Official Technical DocumentationVerified on November 30, 2026
