label-studio icon indicating copy to clipboard operation
label-studio copied to clipboard

`maxlength` for `TextArea` tag

Open go-inoue opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe.

  • I want to have a input length limit for TextArea tag.

Describe the solution you'd like

  • Having a parameter maxlength as in HTML for TextArea tag.

Describe alternatives you've considered

  • This can be done with JavaScript, but I wasn't sure how to include a custom script within Label Studio.

Additional context

  • This feature is useful when you want to limit the max length of user input, for example, when you annotate for summarization.

go-inoue avatar Jul 20 '23 04:07 go-inoue

Hey @go-inoue ! Thank you so much for your feedback!

This would be a nice feature request — I'll flag it internally and please feel free to follow up if you have any questions.

erinmikailstaples avatar Jul 20 '23 18:07 erinmikailstaples

I have implemented the single-char-wise max length validation functionality to my label-studio-frontend fork as follows. Please feel free to cherry-pick if you'd like it. (However, my impl may be different from LabelStudio's policy, because I'm unfamiliar with JS, React and Mobx...)

commit: https://github.com/ciela/label-studio-frontend/pull/1/commits/28d39c5293ce93493fe208e9016dc3a0e6896513

image

image

ciela avatar Jul 24 '23 10:07 ciela

Hello @makseq What’s the state of this issue? do you plan on merging the proposed solution ? Thanks !

CrisRodriguez avatar Apr 04 '24 08:04 CrisRodriguez

@CrisRodriguez hey, have you ever made a PR from this commit?

makseq avatar Apr 04 '24 09:04 makseq