Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Form] Add the html5 option to ColorType to validate the input#36302

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromfancyweb:form-color-constraint
May 5, 2020

Conversation

fancyweb
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?yes
Deprecations?no
Ticketsno
LicenseMIT
Doc PRTODO

Continuation of#35626.

I'm resubmitting the initial implementation, this time in the Form component.

ThisColor constraint is dedicated to the HTML5 input type="color".

Copy link
Contributor

@HeahDudeHeahDude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What about astrict_html5 option in aColorValidatorTypeExtension for theColorType that adds it with a normalizer automatically?

@stof
Copy link
Member

stof commentedApr 1, 2020

Constraints should not be implemented in the Form component IMO.

@HeahDude
Copy link
Contributor

So a solution could be to use the normalizer to add aRegex constraint when the option is true.

@HeahDude
Copy link
Contributor

So a solution could be to use the normalizer to add a Regex constraint when the option is true.

But then we should not require the Validator component for such option, add do it in theColorType directly using apreg_match in a listener instead.

@xabbuh
Copy link
Member

I agree, this could simply be part of theColorType. For consistency with other form types I suggest to add anhtml5 option which renders an HTML5input="type" widget and performs these validation rules.

@nicolas-grekasnicolas-grekas added this to thenext milestoneApr 3, 2020
@fancywebfancywebforce-pushed theform-color-constraint branch 2 times, most recently from31b82a2 to0f352fbCompareApril 8, 2020 10:20
@fancywebfancyweb changed the title[Form] Add the color constraint[Form] Add the html5 option to ColorType to validate the inputApr 8, 2020
@fancyweb
Copy link
ContributorAuthor

fancyweb commentedApr 8, 2020
edited
Loading

I took your ideas into consideration. That's kind of out of my initial use case but it's still going to be useful.

which renders an HTML5 input="type" widget

AFAIK, that's already the case.

@fancyweb
Copy link
ContributorAuthor

do it in the ColorType directly using a preg_match in a listener instead.

Should we however add a RegExp constraint (and skip the listener) if the Validator component is there?

@fancywebfancywebforce-pushed theform-color-constraint branch from0f352fb tocaead2dCompareApril 8, 2020 12:21
@fancywebfancywebforce-pushed theform-color-constraint branch 2 times, most recently from889c936 to56fd5d5CompareApril 14, 2020 12:11
@nicolas-grekasnicolas-grekas modified the milestones:next,5.1May 4, 2020
@fabpot
Copy link
Member

Thank you@fancyweb.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@stofstofstof left review comments

@HeahDudeHeahDudeHeahDude requested changes

@fabpotfabpotfabpot approved these changes

@xabbuhxabbuhxabbuh approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
5.1
Development

Successfully merging this pull request may close these issues.

7 participants
@fancyweb@stof@HeahDude@xabbuh@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp