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

Question mark issue #117

Closed
charlielangridge opened this issue Aug 24, 2018 · 15 comments
Closed

Question mark issue #117

charlielangridge opened this issue Aug 24, 2018 · 15 comments
Assignees
Labels
bug Verified bug by the Nova team

Comments

@charlielangridge
Copy link

When I try to type a ? (Windows 10 / Chrome), it always jumps to the global search bar - is there a way to disable this, either globally or (preferably) when filling in a field

@bradykeeling
Copy link

I'm still having this same issue using Nova version 1.0.8. (macOS 10.13.6 / Chrome)

@bradykeeling
Copy link

Also, this is specific to the Trix editor.

@richfoxton
Copy link

It also happens when using other WYSIWG editors, especially where they are operating in 'inline' mode.

@hocza
Copy link

hocza commented Sep 10, 2018

Still having this issue. – Nova 1.0.14

Safari&Chrome on MAC.

I see this is an intended function (if you're not editing stuff, e.g. just try to type ? even on a resource index) but bugged with WYSIWG editors in inline mode as @richfoxton pointed out.

@davidhemphill davidhemphill added the bug Verified bug by the Nova team label Sep 10, 2018
@Jam0r85
Copy link

Jam0r85 commented Sep 11, 2018

Happens when typing 'e' as well into a textfield.

@davidhemphill
Copy link
Contributor

This has been fixed and will be included in an upcoming release.

@charger513
Copy link

The problem is still present with other WYSIWG editors in Nova 1.1.3

@davidhemphill
Copy link
Contributor

What other editors? This is fixed with both the Trix and Markdown fields.

@charger513
Copy link

What other editors? This is fixed with both the Trix and Markdown fields.

https://github.com/chmln/vue-wysiwyg
https://github.com/ankurk91/vue-trumbowyg

@davidhemphill
Copy link
Contributor

These editors need to stop propagation of those events up to the global handler. This is not a bug in Nova.

@reado
Copy link

reado commented Sep 25, 2018

These editors need to stop propagation of those events up to the global handler. This is not a bug in Nova.

I totally get that the vue component needs to stop propation of those events, @davidhemphill do you mind elaborating a little bit more? Like in the case of the Trix editor, is there something straight forward that we can put into our components to prevent this?

Any help would be appreciated. Thanks!

@davidhemphill
Copy link
Contributor

Sure. If you check out the source to Trix.vue you'll see this template block:

<template>
    <trix-editor
        ref="theEditor"
        @keydown.stop
        @trix-change="handleChange"
        @trix-initialize="initialize"
        @trix-attachment-add="handleAddFile"
        @trix-attachment-remove="handleRemoveFile"
        @trix-file-accept="handleFileAccept"
        :value="value"
        :placeholder="placeholder"
        class="trix-content"
    />
</template>

In there we're listening for the keydown event from the trix-editor and using @keydown.stop to stop those events from bubbling all the way to the document handler. This keeps those keystrokes from triggering our global search along with our edit and create resource bindings.

Does that make sense?

@reado
Copy link

reado commented Sep 27, 2018

@keydown.stop

This totally makes sense.. Thank you! Now it's time to hook it up :D

Thanks again

@bcorcoran
Copy link

bcorcoran commented May 16, 2019

For Tiptap, you must modify the editor config (since it does not emit prosemirror events as vue events) as follows:


new Editor({
    ...,
    editorProps: {
        handleKeyDown: (editorView, keyboardEvent) => {
            // Prevent ? or / from triggering Nova global search
            keyboardEvent.stopPropagation();
        }
    }
});

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Verified bug by the Nova team
Projects
None yet
Development

No branches or pull requests

9 participants