Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/App/components/Hints/Hints.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createPortal } from 'react-dom'
import { useConfig } from '../../store/configContext.js'
import { useService } from '../../store/serviceContext.js'
import { useApp } from '../../store/appContext.js'
import { htmlToPlainText } from '../../../utils/htmlToPlainText.js'

/**
* Renders the active keyboard hint as a toast portaled into im-o-app__main.
Expand Down Expand Up @@ -44,7 +45,7 @@ export const Hints = () => {
<div
id={`${id}-keyboard-desc`}
className='im-u-visually-hidden'
dangerouslySetInnerHTML={{ __html: keyboardHintText }}
dangerouslySetInnerHTML={{ __html: htmlToPlainText(keyboardHintText) }}
/>
</div>,
layoutRefs.mainRef.current
Expand Down
2 changes: 1 addition & 1 deletion src/App/components/Hints/Hints.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('Hints — rendering', () => {
render(<Hints />)
const desc = mainEl.querySelector('#test-map-keyboard-desc')
expect(desc).toBeTruthy()
expect(desc.innerHTML).toBe('<kbd>Shift</kbd> + <kbd>?</kbd>')
expect(desc.innerHTML).toBe('Shift + ?')
})

it('renders no hint content when there is no active hint', () => {
Expand Down
Loading