[wp-trac] [WordPress Trac] #47510: Developer tool - Best Practice - input comment field Does not use passive listeners
WordPress Trac
noreply at wordpress.org
Fri Mar 27 23:32:37 UTC 2020
#47510: Developer tool - Best Practice - input comment field Does not use passive
listeners
------------------------------------+--------------------------------------
Reporter: efilippucci | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Comments | Version: 5.2.1
Severity: normal | Resolution:
Keywords: has-patch needs- | Focuses: javascript, performance
refresh |
------------------------------------+--------------------------------------
Comment (by peterwilsoncc):
Replying to [comment:29 slkfsdf8y34ljhsfsdfkuhfkl84hj]:
> What kind of action is needed for this to move forward....?
In order to use passive listeners the handlers need to be written in a way
that does not rely on `event.preventDefault()`. I don't think this is
possible as the handlers prevent the browser from following the link (a
non-JavaScript fallback) but I'm happy to hear from other contributors.
Lighthouse is an automated tool that warns based on rules of thumb. By
avoiding the need to visit a new page to reply to a comment, the commenter
is able to reply immediately rather than waiting for a new page to load
and render.
I'd caution against blindly following the recommendations of any automated
tool, as it can [https://www.matuzo.at/blog/building-the-most-
inaccessible-site-possible-with-a-perfect-lighthouse-score/ lead to
problems in itself].
As I said, if the listeners can be rewritten so they don't need
`event.preventDefault()` without removing the fallback then I am happy for
this to move forward.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47510#comment:30>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list