Skip to content

Commit 2ec8406

Browse files
authored
fix: cancelling empty prompt (#7010)
1 parent 0c278b0 commit 2ec8406

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/decap-cms-widget-file/src/withFileControl.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,9 @@ export default function withFileControl({ forImage } = {}) {
312312

313313
const url = window.prompt(this.props.t(`editor.editorWidgets.${subject}.promptUrl`));
314314

315-
return this.props.onChange(url);
315+
if (url) {
316+
return this.props.onChange(url);
317+
}
316318
};
317319

318320
handleRemove = e => {

0 commit comments

Comments
 (0)