Sha256: 19d9f225c58ccaf4b3b41dbac1661d2408c3952fe05cdd235d3cc50d02d438fc
Contents?: true
Size: 675 Bytes
Versions: 300
Compression:
Stored size: 675 Bytes
Contents
const useFocus = () => { const allTrixEditors = document.querySelectorAll( '.focus-editor-targets trix-editor' ) allTrixEditors.forEach((editorElement) => { const toolbarElement = editorElement.toolbarElement if (editorElement == document.activeElement) { editorElement.classList.add('focused-editor') toolbarElement.style.display = 'block' } else { // don't hide the toolbar if we've unfocused to focus on the link dialog. if (!toolbarElement.contains(document.activeElement)) { editorElement.classList.remove('focused-editor') toolbarElement.style.display = 'none' } } }) } export default useFocus
Version data entries
300 entries across 300 versions & 1 rubygems