Gooey
Gooey copied to clipboard
DecimalField: "Field is required" message despite entering a number
- [x] OS: Ubuntu 23.10 x86_64
- [x] Python Version: 3.11.6
- [x] Gooey Version: 1.0.8.1
- [x] Thorough description of problem
- [x] Expected Behavior: Setting widget as
DecimalField
for an argument results in capability of inputting an floating point value. - [x] 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.
- [x] Expected Behavior: Setting widget as
- [x] 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()
- [x] Screenshot:
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.