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

fix on enter

parent 46bd1550
No related branches found
No related tags found
No related merge requests found
......@@ -140,6 +140,7 @@ const NumericalAnswerDropDownCompontent = ({ node }) => {
const onKeyDown = (e, index) => {
e.preventDefault();
updateWaxView();
// arrow down
if (e.keyCode === 40) {
if (index === itemRefs.current.length - 1) {
......@@ -191,17 +192,21 @@ const NumericalAnswerDropDownCompontent = ({ node }) => {
};
const onChange = option => {
updateWaxView();
context.setOption({ [node.attrs.id]: { numericalAnswer: option.value } });
setLabel(option.label);
openCloseMenu();
SaveTypeToNode(option.value);
activeView.focus();
};
const updateWaxView = () => {
context.updateView(
{
main: context.pmViews.main,
},
'main',
);
context.setOption({ [node.attrs.id]: { numericalAnswer: option.value } });
setLabel(option.label);
openCloseMenu();
SaveTypeToNode(option.value);
activeView.focus();
};
const NumericalAnswerDropDown = useMemo(
......
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