Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fe2): Don't trigger shortcuts while typing comments #2830

Merged
Changes from 1 commit
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
10 changes: 9 additions & 1 deletion packages/frontend-2/components/viewer/Controls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ import {
} from '@speckle/ui-components'
import {
useInjectedViewerLoadedResources,
useInjectedViewerInterfaceState
useInjectedViewerInterfaceState,
useInjectedViewerState
} from '~~/lib/viewer/composables/setup'
import { useMixpanel } from '~~/lib/core/composables/mp'

Expand Down Expand Up @@ -356,6 +357,8 @@ const {
camera: { isOrthoProjection }
} = useCameraUtilities()

const { ui } = useInjectedViewerState()

const breakpoints = useBreakpoints(TailwindBreakpoints)
const isMobile = breakpoints.smaller('sm')

Expand Down Expand Up @@ -419,7 +422,12 @@ const measureShortcut = ref(
`Measure mode ${getShortcutTitle(ViewerKeyboardActions.ToggleMeasurements)}`
)

const isTyping = computed(() => ui.threads.openThread.isTyping.value)

const handleKeyboardAction = (action: ViewerKeyboardActions) => {
if (isTyping.value) {
andrewwallacespeckle marked this conversation as resolved.
Show resolved Hide resolved
return
}
switch (action) {
case ViewerKeyboardActions.ToggleModels:
toggleActiveControl('models')
Expand Down