Skip to content

Commit

Permalink
Merge pull request #26 from polarbirke/master
Browse files Browse the repository at this point in the history
Hide the HoneypotField from assistive technology (AT)
  • Loading branch information
eymengunay authored Jun 21, 2019
2 parents cb65af7 + 42015ac commit e4e2ae9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Form/Type/HoneypotType.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,12 @@ public function configureOptions(OptionsResolver $resolver)
'mapped' => false,
'data' => '',
'attr' => array(
//autocomplete="off" does not work in some cases, random strings always do
// autocomplete="off" does not work in some cases, random strings always do
'autocomplete' => 'nope',
// Make the field unfocusable for keyboard users
'tabindex' => -1,
// Hide the field from assistive technology like screen readers
'aria-hidden' => 'true',
// Fake `display:none` css behaviour to hide input
// as some bots may also check inputs visibility
'style' => 'position: fixed; left: -100%; top: -100%;'
Expand Down

0 comments on commit e4e2ae9

Please sign in to comment.