Skip to content

Commit

Permalink
fix: when holding shift the shortcuts help show up
Browse files Browse the repository at this point in the history
  • Loading branch information
lexoyo committed Aug 14, 2024
1 parent e926734 commit 17b7791
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/ts/client/grapesjs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import { blocksPlugin } from './blocks'
import { semanticPlugin } from './semantic'
import { orderedList, richTextPlugin, unorderedList } from './rich-text'
import { internalLinksPlugin } from './internal-links'
import {defaultKms, keymapsPlugin, prefixKey} from './keymaps'
import {defaultKms, keymapsPlugin} from './keymaps'
import publicationManagerPlugin, { PublicationManagerOptions } from './PublicationManager'
import ViewButtons from './view-buttons'
import { storagePlugin } from './storage'
Expand Down Expand Up @@ -357,7 +357,8 @@ export function getEditorConfig(config: ClientConfig): EditorConfig {
reverse: true,
},
[keymapsDialogPlugin.toString()]: {
longPressKey: prefixKey,
longPressDuration: null,
shortcut: 'shift+h',
},
[navbarPlugin.toString()]:{
block:{
Expand Down
5 changes: 3 additions & 2 deletions src/ts/client/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ export function selectBody(editor: Editor): void {
* @param element The element to check.
*/
export function isTextOrInputField(element: HTMLElement): boolean {
const isInput: boolean = element.tagName === 'INPUT' && element.getAttribute('type') !== 'submit'
const isOtherFormElement: boolean = ['TEXTAREA', 'OPTION', 'OPTGROUP', 'SELECT'].includes(element.tagName)
if(element.getAttribute('type') === 'submit') return false
const isInput: boolean = element.tagName === 'INPUT'
const isOtherFormElement: boolean = ['TEXTAREA', 'OPTION', 'OPTGROUP', 'SELECT', 'BUTTON'].includes(element.tagName)

return isInput || isOtherFormElement
}
Expand Down

0 comments on commit 17b7791

Please sign in to comment.