From 250a15a60042bbe4870d0c05f745e556503ee5b9 Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Thu, 12 Oct 2023 20:14:26 +0530 Subject: [PATCH] fix library not updating #530 --- src/components/AddLibrary.jsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/AddLibrary.jsx b/src/components/AddLibrary.jsx index dc6e58c..669879a 100644 --- a/src/components/AddLibrary.jsx +++ b/src/components/AddLibrary.jsx @@ -37,19 +37,23 @@ export default class AddLibrary extends Component { } textareaBlurHandler(e, textarea) { const target = e ? e.target : textarea; + const data = { js: this.state.js, css: this.state.css }; + const type = target.dataset.lang; if (type === 'js') { + data.js = target.value || ''; this.setState({ - js: target.value || '' + js: data.js }); } else { + data.css = target.value || ''; this.setState({ - css: target.value || '' + css: data.css }); } // trackEvent('ui', 'addLibrarySelect', target.selectedOptions[0].label); - this.props.onChange({ js: this.state.js, css: this.state.css }); + this.props.onChange(data); } suggestionSelectHandler(value) { const textarea = value.match(/\.js$/)