diff --git a/wax-questions-service/src/NumericalAnswerService/components/NumericalAnswerDropDownCompontent.js b/wax-questions-service/src/NumericalAnswerService/components/NumericalAnswerDropDownCompontent.js index 9bea5b90c93024a2f0dce44182005836fe0bbcdc..249bd2e58a67cccdbb42fa1398b36e9d3a3a71dd 100644 --- a/wax-questions-service/src/NumericalAnswerService/components/NumericalAnswerDropDownCompontent.js +++ b/wax-questions-service/src/NumericalAnswerService/components/NumericalAnswerDropDownCompontent.js @@ -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(