From 8e869baed79074ddb551e70479e6370e9a33a2b7 Mon Sep 17 00:00:00 2001 From: Florian Date: Thu, 18 Jun 2020 10:12:47 +0900 Subject: [PATCH] fix: trim whitespaces from filters --- runtime/dialog.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/dialog.go b/runtime/dialog.go index f835af77..dd28dffb 100644 --- a/runtime/dialog.go +++ b/runtime/dialog.go @@ -1,6 +1,7 @@ package runtime import "github.com/wailsapp/wails/lib/interfaces" +import "strings" // Dialog exposes an interface to native dialogs type Dialog struct { @@ -22,7 +23,7 @@ func (r *Dialog) SelectFile(params ...string) string { title = params[0] } if len(params) > 1 { - filter = params[1] + filter = strings.Replace(params[1], " ", "", -1) } return r.renderer.SelectFile(title, filter) } @@ -40,7 +41,7 @@ func (r *Dialog) SelectSaveFile(params ...string) string { title = params[0] } if len(params) > 1 { - filter = params[1] + filter = strings.Replace(params[1], " ", "", -1) } return r.renderer.SelectSaveFile(title, filter) }