DecimalField: "Field is required" message despite entering a number
mich-j opened this issue · comments
- OS: Ubuntu 23.10 x86_64
- Python Version: 3.11.6
- Gooey Version: 1.0.8.1
- Thorough description of problem
- Expected Behavior: Setting widget as
DecimalField
for an argument results in capability of inputting an floating point value. - Actual Behavior: After typing a floating point number into a
DecimalField
, error message saying "This field is required" pops up. This stops the application from going forward to the execution stage. I tried both typing a number and setting it using plus and minus buttons.
- Expected Behavior: Setting widget as
- A minimal code example
from gooey import Gooey, GooeyParser
ps = GooeyParser()
@Gooey()
def parse_args():
ps.add_argument("val", widget="DecimalField", action="store")
parse_args()
args = ps.parse_args()
By the way, thank you very much for creating Gooey, it's super helpful for me!
You are missing the - infront of the first argument "-val"
@Katzmann1983 Is this an issue or can it be made better if we added '-' internally before the arguments? Let me know if I can work on this if it has to be done.
You are missing the - infront of the first argument "-val"
This was the case, thank you! I think this may be a bug, if DecimalField requires user to put some numbers in, it should not work with optional argument (with "--"), but with positional (i.e. required argument, without dashes).
I have the same issue, but I get This field is required
in every case when setting required=True
(both with a single dash and two dashes) or using a positional, no matter the number that is put in.