question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Render HTML 5 aware input element types

See original GitHub issue

For example, given:

    email: {type: Types.Email},

Then the Admin UI rendered input field should be:

<input autocomplete="off" name="fieldA" value="" type="email" class="FormInput" data-reactid=".1.$=10.0.0.3.1:$fieldA.1:0.0">

Where it is currently:

<input autocomplete="off" name="fieldA" value="" type="text" class="FormInput" data-reactid=".1.$=10.0.0.3.1:$fieldA.1:0.0">

This issue should probably enumerate all other fields that should be HTML 5 type aware and handle them all. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input

DEV NOTE This should be pretty easy to do. Field types use the elemental’s FormInput component to render input fields. You can pass it the type as a prop. For example, for email inputs update EmailField.js as follows:

    <FormInput type="email" ...

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:21 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
adamscybotcommented, Apr 6, 2016

This should be done, however you will want to add the novalidate attribute to each field as as mentioned above, you dont’ want the browsers native client side validation to kick in. a) Because its difficult to style consistently cross browser and b) because you probably wan to handle that logic within the client side app anyway.

Its advantageous to use these correct types though – for one, it brings up the best keyboard on mobile devices.

1reaction
pll33commented, Apr 14, 2016

@webteckie Yeah no problem, I can take ownership on this. I’ll reference issues with the color and time fields later today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The HTML5 input types - Learn web development | MDN
That brings us to the end of our tour of the HTML5 form input types. There are a few other control types that...
Read more >
HTML5 forms input types
In the first article in this series we looked at the history of HTML5 forms and many of the new attributes available to...
Read more >
HTML Input Types - Dofactory
HTML input types -- the best examples. HTML uses different input types such as: button, checkbox, color, date, datetime-local, email, file, hidden, image, ......
Read more >
Explain the form new input types in HTML5 ? - GeeksforGeeks
In this article, we will discuss the functionality of the newer form input types provided by HTML5. Sometimes, while filling the ...
Read more >
HTML5 Form Validation Examples < HTML - The Art of Web
HTML5 form input field attributes in combination with CSS allow you to provide instant feedback on the validity of form input text, including...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found