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

3. Flight Booker #2

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mashrurmorshed
Copy link
Contributor

No description provided.

@mashrurmorshed mashrurmorshed changed the title [WIP] Flight Booker [WIP] 3. Flight Booker Jun 15, 2022
@abidlabs
Copy link
Member

The ability to change interactivity using .update() will be out soon in gradio==3.0.18!

@mashrurmorshed
Copy link
Contributor Author

mashrurmorshed commented Jun 17, 2022

Thanks to the gradio==3.0.18 update, it is possible to implement most of the features.

There is one element of the Flight Booker that I haven't been exactly able to reproduce: if the date formats are wrong, the text boxes are supposed to change color to red.

However, Textbox components don't have any color parameter, while the HighlightedText component doesn't accept user input (so we can't enter date here).

After some thought, as a workaround, I added a hidden HighlightedText box beside each date on the same row. If the entered date has an incorrect format, then the hidden box shows itself and displays the red colored warning; it disappears if the date format is correct.

Like shown below:

image

(If textboxes support background color modification, then we can do away with the extra highlighted box. But I think that'll probably need a major update to component style, which may not be viable in the short term.)

@mashrurmorshed mashrurmorshed marked this pull request as ready for review June 17, 2022 22:16
@mashrurmorshed mashrurmorshed changed the title [WIP] 3. Flight Booker 3. Flight Booker Jun 17, 2022
@abidlabs
Copy link
Member

abidlabs commented Jul 4, 2022

Hmm I'd like to have the red textbox color if possible. Let me create an issue in the gradio repo to request this

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

Successfully merging this pull request may close these issues.

2 participants