Skip to content
Snippets Groups Projects
Commit 326b0e3e authored by chris's avatar chris
Browse files

set unique id for each group

parent 2bc62f4c
No related branches found
No related tags found
1 merge request!307Answer nodeview
......@@ -3,11 +3,8 @@ import { isEmpty } from 'lodash';
import { injectable } from 'inversify';
import { Tools } from 'wax-prosemirror-services';
import { Commands } from 'wax-prosemirror-utilities';
import { Fragment } from 'prosemirror-model';
import { findWrapping } from 'prosemirror-transform';
import { v4 as uuidv4 } from 'uuid';
import helpers from './helpers/helpers';
import ToolBarBtn from './components/ToolBarBtn';
const checkifEmpty = view => {
......
......@@ -3,13 +3,12 @@ import React, { useContext, useMemo } from 'react';
import { WaxContext } from 'wax-prosemirror-core';
import styled, { css } from 'styled-components';
import { MenuButton } from 'wax-prosemirror-components';
import { Commands } from 'wax-prosemirror-utilities';
import { v4 as uuidv4 } from 'uuid';
import { Fragment } from 'prosemirror-model';
import { TextSelection } from 'prosemirror-state';
import { wrapIn } from 'prosemirror-commands';
import helpers from '../helpers/helpers';
import { v4 as uuidv4 } from 'uuid';
const activeStyles = css`
pointer-events: none;
`;
......@@ -48,10 +47,9 @@ const ToolBarBtn = ({ view = {}, item }) => {
let { $from, $to } = state.selection;
let range = $from.blockRange($to);
wrapIn(state.config.schema.nodes.multiple_choice_container)(
state,
dispatch,
);
wrapIn(state.config.schema.nodes.multiple_choice_container, {
id: uuidv4(),
})(state, dispatch);
/* set New Selection */
dispatch(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment