Skip to content

Instantly share code, notes, and snippets.

View magdielndantas's full-sized avatar
🎯
Concentrando

Magdiel Dantas magdielndantas

🎯
Concentrando
View GitHub Profile
module.exports = {
env: {
browser: true,
es6: true,
jest: true,
},
extends: [
'react-app',
'airbnb',
'plugin:@typescript-eslint/recommended',
@magdielndantas
magdielndantas / outlineAccessibility.js
Created August 8, 2020 00:38
With this code, you’ll remove the outline if you use the mouse, and if you use the keyboard, you’ll enable back all the outlines.
(function(document, window){
if (!document || !window) {
return;
}
var styleText = '::-moz-focus-inner{border:0 !important;}:focus{outline: none !important;';
var unfocus_style = document.createElement('STYLE');
window.unfocus = function(){
document.getElementsByTagName('HEAD')[0].appendChild(unfocus_style);
@magdielndantas
magdielndantas / formsRequireMsg
Created July 3, 2020 08:29
Código para verificação de formulários com html required
const fields = document.querySelectorAll('[required]')
function validateField(field){
//verify if error true
function verifyErrors(){
let foundError = false;
for(let error in field.validity){
if(field.validity[error] && !field.validity.valid){
foundError = error