1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-27 00:30:09 +02:00

fix library not updating #530

This commit is contained in:
Kushagra Gour
2023-10-12 20:14:26 +05:30
parent 6ba1cdb0f3
commit 250a15a600

View File

@@ -37,19 +37,23 @@ export default class AddLibrary extends Component {
} }
textareaBlurHandler(e, textarea) { textareaBlurHandler(e, textarea) {
const target = e ? e.target : textarea; const target = e ? e.target : textarea;
const data = { js: this.state.js, css: this.state.css };
const type = target.dataset.lang; const type = target.dataset.lang;
if (type === 'js') { if (type === 'js') {
data.js = target.value || '';
this.setState({ this.setState({
js: target.value || '' js: data.js
}); });
} else { } else {
data.css = target.value || '';
this.setState({ this.setState({
css: target.value || '' css: data.css
}); });
} }
// trackEvent('ui', 'addLibrarySelect', target.selectedOptions[0].label); // trackEvent('ui', 'addLibrarySelect', target.selectedOptions[0].label);
this.props.onChange({ js: this.state.js, css: this.state.css }); this.props.onChange(data);
} }
suggestionSelectHandler(value) { suggestionSelectHandler(value) {
const textarea = value.match(/\.js$/) const textarea = value.match(/\.js$/)