diff --git a/resources/skins.vector.es6/tableOfContents.js b/resources/skins.vector.es6/tableOfContents.js index 07b85abc..fede0ee9 100644 --- a/resources/skins.vector.es6/tableOfContents.js +++ b/resources/skins.vector.es6/tableOfContents.js @@ -294,9 +294,13 @@ module.exports = function tableOfContents( props ) { /** @type {HTMLElement | null} */ ( e.target.closest( `.${SECTION_CLASS}` ) ); if ( tocSection && tocSection.id ) { - if ( e.target.classList.contains( LINK_CLASS ) ) { + // In case section link contains HTML, + // test if click occurs on any child elements. + if ( e.target.closest( `.${LINK_CLASS}` ) ) { props.onHeadingClick( tocSection.id ); } + // Toggle button does not contain child elements, + // so classList check will suffice. if ( e.target.classList.contains( TOGGLE_CLASS ) ) { props.onToggleClick( tocSection.id ); } diff --git a/resources/skins.vector.styles/components/TableOfContents.less b/resources/skins.vector.styles/components/TableOfContents.less index fd2a12b0..47a390d1 100644 --- a/resources/skins.vector.styles/components/TableOfContents.less +++ b/resources/skins.vector.styles/components/TableOfContents.less @@ -26,21 +26,12 @@ border: 0; } - .sidebar-toc-link { - word-break: break-word; - - > * { - // Prevent click events on the link's contents so that we can use event - // delegation and have the target be the anchor element instead. - pointer-events: none; - } - } - .sidebar-toc-numb { display: none; } .sidebar-toc-link { + word-break: break-word; color: @color-link; }