Gooey icon indicating copy to clipboard operation
Gooey copied to clipboard

DecimalField: "Field is required" message despite entering a number

Open mich-j opened this issue 1 year ago • 4 comments

  • [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] 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: Screenshot from 2023-11-21 21-49-11

By the way, thank you very much for creating Gooey, it's super helpful for me!

mich-j avatar Nov 21 '23 21:11 mich-j

You are missing the - infront of the first argument "-val"

Katzmann1983 avatar Dec 12 '23 13:12 Katzmann1983

@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.

SarthakNikhal avatar Dec 12 '23 19:12 SarthakNikhal

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).

mich-j avatar Dec 12 '23 20:12 mich-j

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.

moqmar avatar Feb 12 '24 07:02 moqmar