Remove leading/trailing space from keys/values
authorRichard Fairhurst <richard@systemeD.net>
Fri, 24 Mar 2017 14:15:21 +0000 (14:15 +0000)
committerRichard Fairhurst <richard@systemeD.net>
Fri, 24 Mar 2017 14:15:21 +0000 (14:15 +0000)
net/systemeD/potlatch2/TagGrid.mxml

index bed408f..a04be01 100644 (file)
@@ -66,6 +66,7 @@
 
                import net.systemeD.halcyon.connection.*;
                import mx.collections.*;
+               import mx.utils.StringUtil;
 
                private var selectedEntity:Entity;
                private var tagDataProvider:ArrayCollection;
                                        if (event.newValue && event.key) {
                                                if (!set) {
                                                        // this entry in the dataProvider has changed
-                                                       tagDataProvider[i].key=event.key;
-                                                       tagDataProvider[i].value=event.newValue;
+                                                       tagDataProvider[i].key = StringUtil.trim(event.key);
+                                                       tagDataProvider[i].value = StringUtil.trim(event.newValue);
                                                        set=true;
                                                } else {
                                                        // trap duplicate tags