Skip to content

Commit

Permalink
Sanitize fields from latin chars (#5)
Browse files Browse the repository at this point in the history
Thanks! 
Appreciate the PR!
  • Loading branch information
daguilarm authored and davidpiesse committed Oct 12, 2018
1 parent 27e3f0b commit 97ddf9f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions resources/js/components/FormField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<default-field :field="field">
<template slot="field">
<div class="py-2">
<toggle-button
:id="field.name"
:name="field.name"
<toggle-button
:id="sanitizedName"
:name="sanitizedName"
:value="value"
@change="toggle"
:labels="labelConfig"
Expand Down Expand Up @@ -92,6 +92,14 @@ export default {
speed(){
return (this.field.speed != undefined) ? this.field.speed : 300
},
<<<<<<< HEAD
sanitizedName() {
=======
sanitize() {
>>>>>>> 64ac66607d4fb77e8172ff7f4a28cf66d2ae10e4
return this.field.name.normalize('NFD').replace(/[\u0300-\u036f]/g, "")
},
},
}
</script>

0 comments on commit 97ddf9f

Please sign in to comment.