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

Let TextArea (SelectionField, calendars) have required, autofocus HTML5 attributes. #44

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

nphilipp
Copy link

@nphilipp nphilipp commented Dec 7, 2015

This lets developers set required on the widget, making it more
similar in look and field to other input fields.

@amol-
Copy link
Contributor

amol- commented Dec 8, 2015

As pointed out by testsuite,
this ended up adding an extra value= attribute which wasn't expected

AssertionError: Attributes do not match: value='6', value=None
xml1 <textarea  rows="6" cols="10" value="6" class="something">6</textarea>
 does not equal xml2
 <textarea class="something" rows="6" cols="10">6</textarea>

@moschlar
Copy link
Member

moschlar commented Dec 8, 2015

Do you have a specific reason for this PR?

Because, conceptually, a textarea just isn't an input field (the naming there is analogous to the html tags).

@nphilipp
Copy link
Author

nphilipp commented Dec 8, 2015

The purpose of this was to be able to set required on the TextArea widget, so it gets rendered the similarly to other input fields, i.e. gets a red border if focused and the user hasn't entered anything yet.

I guess the shortcut I took was too short, so it's back to the drawing board. ;)

@nphilipp
Copy link
Author

nphilipp commented Dec 8, 2015

Skimming the HTML form fields documentation it seems as if required (and autofocus) could just as well go into FormField, but there's the conflicting(?) FormField.required property. What's the meaning of it? In many form field widgets it's shadowed by InputField.required (a Param) anyway.

@nphilipp nphilipp changed the title Derive TextArea from InputField. Let TextArea (SelectionField, calendars) have required, autofocus HTML5 attributes. Dec 21, 2015
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.

3 participants