Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
8 tasks done
mich-j opened this issue Nov 21, 2023 · 4 comments
Open
8 tasks done

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

mich-j opened this issue Nov 21, 2023 · 4 comments

Comments

@mich-j
Copy link

mich-j commented Nov 21, 2023

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

  • 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!

@Katzmann1983
Copy link

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

@SarthakNikhal
Copy link

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

@mich-j
Copy link
Author

mich-j commented Dec 12, 2023

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

@moqmar
Copy link

moqmar commented Feb 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants