jquery / jquery/jquery-ui

datepicker: ui-datepicker-div always visible after init

Open
#2,149 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Behavior shared with 1.12 Comp: Datepicker
Dominant language
JavaScript
Stars
11.3k
Forks
5.2k
PR merge metrics
No merged PRs in 30d

Description

Versions:

  • jQuery 3.6.1
  • jquery ui 1.13.2

Prerequisites:

  • css applied:
    .ui-datepicker { border: 1px solid #ccc; padding: 6px;

Reproduction path:

  • Initialize datepicker on input field

Expected behavior:

  • .ui-datepicker div is not visible

Current behavior:

  • .ui-datepicker div is visible, causing a small box to appear at the bottom of the page

Discussion:

  • The div is only visible after initialization and before the first time showing the widget. After hiding the widget, datepicker applies style display: none to the div.
  • This can't be fixed by adding display: none to the class ourselves, because the code to show the widget does not apply a different display value in-line. It just removes the display: none inline style. Thus, applying display: none in our css results in the widget never being shown.
  • My conclusion: jquery-ui should set display: none on initialisation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the datepicker initialization described in the issue with the listed jQuery and jQuery UI versions, then inspect the datepicker initialization and show/hide behavior. Done means the widget is hidden after initialization, remains usable when first shown, and still hides correctly afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, jquery
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.