-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Adding maxlength
attribute handling of textarea
and input
HTML element for the gr.TextBox()
component via a max_length
parameter
#9185
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-pypi-previews.s3.amazonaws.com/7e61de7189376dbc10042a791ae0025b8789f3ec/gradio-4.42.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@7e61de7189376dbc10042a791ae0025b8789f3ec#subdirectory=client/python" Install Gradio JS Client from this PR npm install https://gradio-npm-previews.s3.amazonaws.com/7e61de7189376dbc10042a791ae0025b8789f3ec/gradio-client-1.5.1.tgz |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
Thanks @abidlabs for the clues! |
Hi @WH-Yoshi is there a reason you closed this PR? |
Hi yes, the tests are unsuccessful and I don't find the issue, so I wanted to make sure on my part before opening a PR maybe |
You mind if I reopen and take a quick look? |
Sure, I'm a bit lost ngl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @WH-Yoshi, thanks for the nice PR! Just made a small addition to gradio/templates.py
maxlength
attribute handling of textarea
and input
HTML element for the gr.TextBox()
componentmaxlength
attribute handling of textarea
and input
HTML element for the gr.TextBox()
component via a max_length
parameter
Description
This PR aims to be able to modify the maximum number of characters to insert in a
gr.TextBox()
.To do this, a
max_length
parameter is added to thegr.TextBox()
component.This results in the modification of the svelte files for this component with the addition of a prop handler named
max_length
which will give its value to the HTML attributemaxlength
responsible for the limit.Closes: #9145
All tests have been run, some of them failed for unknown reasons or not caused by the modification of these last files.