Skip to content

[BUG] input_field.py: AssertionError: assert self._drag_start is not None #75

@DuckyMomo20012

Description

@DuckyMomo20012

Describe the bug

  • I got this error when I focus on an InputField, then drag the Container border (box) of another InputField. This error happens when I wrap the InputField with the Container widget.
  • I have tested most types of boxes and still see this error, except the EMPTY box type.
  • This error only happens when I focus (click the area inside the Container border) on the first InputField and then drag the border (box) of the second InputField. Note that it won't happen when I focus on the first InputField and then focus on the second InputField.
  • It's strange that this error doesn't happen when I tested it on Replit 🤔, it only happens in my local environment. You can copy the snippet code below and test it on Replit.

To Reproduce
Steps to reproduce the behavior:

  1. You can copy the snippet code below:
import pytermgui as ptg

with ptg.WindowManager() as manager:
    ptg.boxes.ROUNDED.set_chars_of(ptg.Container)

    window = ptg.Window(
        ptg.Label("Email"),
        ptg.Container(ptg.InputField()),
        ptg.Label("Password"),
        ptg.Container(ptg.InputField()),
    )
    window.vertical_align = ptg.VerticalAlignment.TOP
    manager.add(window)
    manager.run()

NOTE: The Label widget is just for separating the InputField, you can remove it.

  1. Run the program.
  2. Click your mouse on the InputField below the "Email" label. NOTE: area inside the Container border, not the border.
  3. Then use your mouse drag down (or up/left/right) the bottom (or top/left/right) border of the InputField below the "Password" label. NOTE: drag the border, not the area inside the Container border.
  4. See error.

Expected behavior
Nothing happens, because I just drag the border.

Screenshots
Error message:
error message

System information

PyTermGUI version 6.4.0

System details:
    Python version: 3.10.4
    $TERM:          xterm-256color
    $COLORTERM:     truecolor
    Color support:  ColorSystem.TRUE
    OS Platform:    Linux-5.15.0-40-generic-x86_64-with-glibc2.35

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions