Skip to content

Dropdown issue #114

@AhmedMomen-EL

Description

@AhmedMomen-EL

The problem appeared about a month ago. The same code was working without problems, and I don't know why. The dropdown works fine, but when I try to change the month or year using the month or year buttons, the dropdown menu automatically disappears, leaving me unable to select a month or year.

When I changed the code to this:

Image Image

and this is the code where i deal with it

             if field_type == "date":
                date_container = ttk.Frame(section_frame)
                date_container.grid(row=r*2+1, column=c, padx=5, pady=(0,10), sticky='we')

                entry = CustomDateEntry(
                    date_container,
                    textvariable=var,
                    width=15,
                    foreground='white',
                    date_pattern='yyyy-mm-dd',
                    state="readonly"
                )
                entry.pack(side='left', fill='x', expand=True)

                clear_date(entry)

                clear_btn = ttk.Button(
                    date_container,
                    text="✕",
                    width=2,
                    command=lambda e=entry: clear_date(e)
                )
                clear_btn.pack(side='right', padx=(5,0))

                entry_vars[key] = entry
            else:
                entry = ttk.Entry(section_frame, textvariable=var, width=22)
                entry.grid(row=r*2+1, column=c, padx=5, pady=(0,10))
                entry_vars[key] = var
Image

The problem became:
It allows me to select the date the first time without any problems, but when I try to select the date again, the same problem occurs when I try to change the month or year, and I have to select a different cell to solve the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions