From a2044c45287287c797df3f241b7f52ed74a4b8c5 Mon Sep 17 00:00:00 2001 From: Matthew Campbell Date: Tue, 6 Nov 2018 15:11:52 -0800 Subject: [PATCH] UX: Make the edits indicator a real link for accessibility (#6570) This link didn't have an `href` attribute, so it wasn't in the tab order. This commit fixes that, while adding a call to `preventDefault` in the event handler to avoid any regression in event handling. --- .../discourse/widgets/post-edits-indicator.js.es6 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/post-edits-indicator.js.es6 b/app/assets/javascripts/discourse/widgets/post-edits-indicator.js.es6 index 302d53f65c8..451e2332595 100644 --- a/app/assets/javascripts/discourse/widgets/post-edits-indicator.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-edits-indicator.js.es6 @@ -62,13 +62,14 @@ export default createWidget("post-edits-indicator", { "a", { className, - attributes: { title } + attributes: { title, href: "#" } }, contents ); }, - click() { + click(e) { + e.preventDefault(); if (this.attrs.wiki && this.attrs.version === 1) { this.sendWidgetAction("editPost"); } else if (this.attrs.canViewEditHistory) {