diff --git a/lime/ui/FileDialog.hx b/lime/ui/FileDialog.hx index 26eb109b4..07aa6c1bf 100644 --- a/lime/ui/FileDialog.hx +++ b/lime/ui/FileDialog.hx @@ -75,6 +75,13 @@ class FileDialog { var path:String = cast result; + // Makes sure the filename ends with extension + if (type == SAVE && filter != null && !StringTools.endsWith (path, "." + filter) ) { + + path += "." + filter; + + } + if (path != null) { onSelect.dispatch (path); @@ -205,4 +212,4 @@ class FileDialog { } -} \ No newline at end of file +}