Skip to content

Commit

Permalink
fix: avoid to make input caret jump during editing declaration (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsn committed Mar 21, 2018
1 parent e83fe23 commit dd09ab6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/view/components/StyleInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ export default Vue.extend({
},
methods: {
inputStyleProp(path: number[], rawProp: string): void {
inputStyleProp(path: number[], prop: string): void {
this.$emit('update-declaration', {
path,
prop: rawProp.trim()
prop
})
},
inputStyleValue(path: number[], rawValue: string): void {
inputStyleValue(path: number[], value: string): void {
this.$emit('update-declaration', {
path,
value: rawValue.trim()
value
})
},
Expand All @@ -69,6 +69,8 @@ export default Vue.extend({
this.$emit('remove-declaration', {
path
})
} else {
this.inputStyleProp(path, prop)
}
},
Expand All @@ -78,6 +80,8 @@ export default Vue.extend({
this.$emit('remove-declaration', {
path
})
} else {
this.inputStyleValue(path, value)
}
},
Expand Down

0 comments on commit dd09ab6

Please sign in to comment.