{"action":"created","issue":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/5883","repository_url":"https://api.github.com/repos/WordPress/gutenberg","labels_url":"https://api.github.com/repos/WordPress/gutenberg/issues/5883/labels{/name}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/issues/5883/comments","events_url":"https://api.github.com/repos/WordPress/gutenberg/issues/5883/events","html_url":"https://github.com/WordPress/gutenberg/issues/5883","id":309738071,"number":5883,"title":"HTML5 validation not respected.","user":{"login":"Stiofan","id":10433311,"avatar_url":"https://avatars3.githubusercontent.com/u/10433311?v=4","gravatar_id":"","url":"https://api.github.com/users/Stiofan","html_url":"https://github.com/Stiofan","followers_url":"https://api.github.com/users/Stiofan/followers","following_url":"https://api.github.com/users/Stiofan/following{/other_user}","gists_url":"https://api.github.com/users/Stiofan/gists{/gist_id}","starred_url":"https://api.github.com/users/Stiofan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stiofan/subscriptions","organizations_url":"https://api.github.com/users/Stiofan/orgs","repos_url":"https://api.github.com/users/Stiofan/repos","events_url":"https://api.github.com/users/Stiofan/events{/privacy}","received_events_url":"https://api.github.com/users/Stiofan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-29T12:38:01Z","updated_at":"2018-03-29T14:53:28Z","closed_at":null,"author_association":"NONE","body":"## Issue Overview\r\n<!-- This is a brief overview of the issue --->\r\nHTML5 Validation is not respected by the block settings, for example \"required\" or for input type number the max or min values.\r\n\r\n## Steps to Reproduce (for bugs)\r\n<!-- Provide a link to a live example, or an unambiguous set of steps to -->\r\n<!-- reproduce this bug. Include code to reproduce, if relevant -->\r\n1. Create a input with type=number and set the max, min and required attributes\r\n2. Try to submit it as empty (works, it should not)\r\n3. Try to submit it with out of bound values (works, it should not)\r\n\r\n`\r\n\r\n{\r\n  | label: 'Height:',\r\n  | help: 'This is the height of the map, for static maps you can only use px values.',\r\n  | value: props.attributes.static_height,\r\n  | type: 'number',\t\t\t\t\t\t\t\t\t\t\tplaceholder: '400',\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'max': '2000','min': '100','required': 'required',\t\t\t\t\t\t\t\t\t\t\tonChange: function ( static_height ) {\r\n  | props.setAttributes({ static_height: static_height } )\t\t\t\t\t\t\t\t\t\t\t}\r\n  | }\r\n\r\n`\r\n\r\n\r\n<!-- Provide what browser you are using and any other specifics to your setup -->\r\nChrome, on Ubuntu \r\n## Expected Behavior\r\n<!-- If you're describing a bug, tell us what should happen -->\r\n<!-- If you're suggesting a change/improvement, tell us how it should work -->\r\nI expect it should respect the html5 validation and not submit or save the values.\r\nI understand these values are updated live and not fully part of the form submission, so maybe our best bet is for \"required\" give it a red border but for max/min this should be easy enough to implement\r\n\r\n## Current Behavior\r\n<!-- If describing a bug, tell us what happens instead of the expected behavior -->\r\n<!-- If suggesting a change/improvement, explain the difference from current behavior -->\r\nit submits and saves the out of bounds values.\r\n\r\n## Possible Solution\r\n<!-- Not obligatory, but suggest a fix/reason for the bug, -->\r\n<!-- or ideas how to implement the addition or change -->\r\n\r\n## Screenshots / Video\r\n<!-- Visual records are oxygen for others to understand what you are sharing -->\r\n\r\n## Related Issues and/or PRs\r\n<!-- List related issues or PRs against other branches -->\r\n\r\n## Todos\r\n- [ ] Tests\r\n- [ ] Documentation\r\n"},"comment":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/comments/377261344","html_url":"https://github.com/WordPress/gutenberg/issues/5883#issuecomment-377261344","issue_url":"https://api.github.com/repos/WordPress/gutenberg/issues/5883","id":377261344,"user":{"login":"aduth","id":1779930,"avatar_url":"https://avatars1.githubusercontent.com/u/1779930?v=4","gravatar_id":"","url":"https://api.github.com/users/aduth","html_url":"https://github.com/aduth","followers_url":"https://api.github.com/users/aduth/followers","following_url":"https://api.github.com/users/aduth/following{/other_user}","gists_url":"https://api.github.com/users/aduth/gists{/gist_id}","starred_url":"https://api.github.com/users/aduth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduth/subscriptions","organizations_url":"https://api.github.com/users/aduth/orgs","repos_url":"https://api.github.com/users/aduth/repos","events_url":"https://api.github.com/users/aduth/events{/privacy}","received_events_url":"https://api.github.com/users/aduth/received_events","type":"User","site_admin":false},"created_at":"2018-03-29T14:53:28Z","updated_at":"2018-03-29T14:53:28Z","author_association":"MEMBER","body":"Related Slack discussion: https://wordpress.slack.com/archives/C02QB2JS7/p1522328142000263\r\n\r\nMy thoughts: We need to better understand the use cases where one would expect to use validation. I expect it has to do with having required fields for a block before allowing the post to be saved. In which case, we might want to consider taking this consideration out of the markup alone, and making it a property of the attribute itself (a required block attribute). Alternatively, or in addition, in the context of the editor, we should consider when validation should occur; immediately? At the time of save?"}}
{"actor":{"display_login":"aduth"}}