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

UrlType are always changed to text types #31283

Closed
lmlsna opened this issue Apr 27, 2019 · 3 comments
Closed

UrlType are always changed to text types #31283

lmlsna opened this issue Apr 27, 2019 · 3 comments

Comments

@lmlsna
Copy link

lmlsna commented Apr 27, 2019

Symfony version(s) affected: 4.1.11 +

Description
Both of these PRs were merged:
#29926 = Changed UrlType input type to text when default_protocol is not null
wallabag/wallabag#3879 = Force default_protocol to generate an url input

So now we are forcing a default protocol, AND changing the type to text if there's a default protocol (which there always is, because we force it).

So this element never renders as a type="url" now. And because it writes to the $view var "type", we have no way to override that.

It doesn't make much sense to change a UrlType to a TextType, and the inputmode attribute was obsoleted in the WC5.2. If you just remove that bit, it works like all the other extended text types.

How to reproduce
Create a UrlType form element.

Possible Solution
I can send a PR fixing this by not forcing a type="text" anymore in Symfony\Component\Form\Extension\Core\Type\UrlType

Additional context

@MatTheCat
Copy link
Contributor

Where did you see inputmode was obsoleted? https://html.spec.whatwg.org/dev/interaction.html#attr-inputmode doesn't seem to mention it.

Also why are you saying

It doesn't make much sense to change a UrlType to a TextType

Did you read #29690 at all?

@lmlsna
Copy link
Author

lmlsna commented Apr 30, 2019

@MatTheCat inputmode is not mentioned in 5.2 of the spec, so I presume it's not going to be used, but you're correct that it's not currently obsoleted.

I was just confused as to why the type was being changed to "text", my mistake.

@lmlsna lmlsna closed this as completed Apr 30, 2019
@stof
Copy link
Member

stof commented Apr 30, 2019

We are not forcing a default protocol. We are defaulting to have one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants