slate-editor | A complete rich text editor based on SlateJS framework | Editor library

 by   nossas JavaScript Version: Current License: MIT

kandi X-RAY | slate-editor Summary

kandi X-RAY | slate-editor Summary

slate-editor is a JavaScript library typically used in Editor, React applications. slate-editor has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can install using 'npm i @slate-editor/utils' or download it from GitHub, npm.

A complete rich text editor based on SlateJS framework
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              slate-editor has a low active ecosystem.
              It has 231 star(s) with 52 fork(s). There are 15 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 20 open issues and 42 have been closed. On average issues are closed in 59 days. There are 7 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of slate-editor is current.

            kandi-Quality Quality

              slate-editor has 0 bugs and 0 code smells.

            kandi-Security Security

              slate-editor has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              slate-editor code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              slate-editor is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              slate-editor releases are not available. You will need to build from source code and install.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.
              It has 473 lines of code, 0 functions and 134 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of slate-editor
            Get all kandi verified functions for this library.

            slate-editor Key Features

            No Key Features are available at this moment for slate-editor.

            slate-editor Examples and Code Snippets

            No Code Snippets are available at this moment for slate-editor.

            Community Discussions

            QUESTION

            Why does popper jump to top-left corner when underlying component re-renders?
            Asked 2020-Sep-04 at 22:02

            I am using the Material-UI Popper component (which in turn uses popper.js) to create a hovering toolbar. For the most part it is working well, except for one odd behavior:

            1. Select some text: the hovering toolbar appears above the text - as expected.
            2. Select any button in the toolbar: the appropriate action is performed. However the toolbar jumps to the top-left corner of the window. See below.

            You can try out this behavior in my Storybook - just select some text and click on one of the "T" buttons.

            The basic issue centers around positioning of the popper:

            1. When user selects some text, a fake virtual element is created and passed to the popper as an anchor element. Popper uses this anchorEl to position the hovering toolbar. So far so good.
            2. When the user clicks on a button in the toolbar, the hovering toolbar jumps to the top-left of the window.

            I am guessing this is happening because the anchor element is somehow lost when the underlying component re-renders. I don't know why, but this is just my theory. Can someone help me solve this issue?

            The code that computes the anchorEl sits inside a React useEffect(). I have made sure that the dependency list for the useEffect is accurate. I can see that when the toolbar jumps, the useEffect() is NOT being called, which means that anchorEl is not being recomputed. This leads me to believe that the toolbar should stay intact in its current position and not jump to (0,0). But that's not happening :-(.

            Here's the useEffect() code inside the toolbar component. You can find the full code in my repo. Any help would be much appreciated.

            ...

            ANSWER

            Answered 2020-Sep-04 at 22:02

            I believe your domRange is no longer valid after toggleBlock does its work (due to dom nodes getting replaced), so getBoundingClientRect is no longer returning anything meaningful.

            You should be able to fix this by redoing the work of getting the range within the anchorEl's getBoundingClientRect. Perhaps something like the following (I didn't try to execute it, so no guarantee that there aren't minor errors):

            Source https://stackoverflow.com/questions/63747451

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install slate-editor

            The slate-editor is available as an npm package.

            Support

            To help us develop new features or fix bugs, to setup your development environment is too simple. Just follow the steps:.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/nossas/slate-editor.git

          • CLI

            gh repo clone nossas/slate-editor

          • sshUrl

            git@github.com:nossas/slate-editor.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Editor Libraries

            quill

            by quilljs

            marktext

            by marktext

            monaco-editor

            by microsoft

            CodeMirror

            by codemirror

            slate

            by ianstormtaylor

            Try Top Libraries by nossas

            bonde-clients

            by nossasTypeScript

            bonde

            by nossasJavaScript

            panela-de-pressao

            by nossasJavaScript

            facaacontecer

            by nossasRuby

            me-representa

            by nossasHTML