bczsalba / pytermgui

Python TUI framework with mouse support, modular widget system, customizable and rapid terminal markup language and more!
https://ptg.bczsalba.com
MIT License
2.21k stars 54 forks source link

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

Closed DuckyMomo20012 closed 2 years ago

DuckyMomo20012 commented 2 years ago

Describe the bug

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.

2. Run the program.
3. Click your mouse on the `InputField` below the "Email" label. NOTE: area **inside** the `Container` border, not the border.
4. 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.
5. See error.

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

**Screenshots**
Error message:
![error message](https://user-images.githubusercontent.com/64480713/178642890-1a506982-336a-40d9-af0a-8749e0e0c35e.png)

**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

bczsalba commented 2 years ago

Will look into this after the next version release, thank you!

P.S. Your project is the first full-fledged PTG application I've seen, and it looks great! Good job!

bczsalba commented 2 years ago

Should work now! Could you confirm?

DuckyMomo20012 commented 2 years ago

Should work now! Could you confirm?

Sorry for the late response, I tested with version 7.0.0 and the system information mentioned in the issue description, and I can see that the error is resolved 👌.