]> Untitled Git - lemmy-ui.git/commitdiff
Merge pull request #1568 from jsit/fix/fix-dropdown-id-unique
authorSleeplessOne1917 <abias1122@gmail.com>
Sun, 25 Jun 2023 04:35:39 +0000 (04:35 +0000)
committerGitHub <noreply@github.com>
Sun, 25 Jun 2023 04:35:39 +0000 (04:35 +0000)
fix(a11y): Fix non-unique ID attribute on re-used element

src/shared/components/post/post-listing.tsx

index d5ddc2f20e5f285d42d00bf23930120e7ac34b10..d11db0dfa3032aa17b6a18dcaebcc172376fb2c6 100644 (file)
@@ -707,13 +707,16 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
             data-tippy-content={I18NextService.i18n.t("more")}
             data-bs-toggle="dropdown"
             aria-expanded="false"
-            aria-controls="advancedButtonsDropdown"
+            aria-controls={`advancedButtonsDropdown${post.id}`}
             aria-label={I18NextService.i18n.t("more")}
           >
             <Icon icon="more-vertical" inline />
           </button>
 
-          <ul className="dropdown-menu" id="advancedButtonsDropdown">
+          <ul
+            className="dropdown-menu"
+            id={`advancedButtonsDropdown${post.id}`}
+          >
             {!this.myPost ? (
               <>
                 <li>{this.reportButton}</li>