Skip to content

Commit

Permalink
Merge branch 'main' of github.com:inlang/monorepo into introduce-sett…
Browse files Browse the repository at this point in the history
…ings-component-into-sherlock
  • Loading branch information
felixhaeberle committed Apr 10, 2024
2 parents b123c3d + aeb98f8 commit 4f9cc6b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ export class DefaultArrayInput extends LitElement {
if (this._inputValue && this._inputValue.trim() !== "") {
this.value ? this.value.push(this._inputValue) : (this.value = [this._inputValue])
this.handleInlangProjectChange(this.value, this.property, this.moduleId)
this._inputValue = "null"
this._inputValue = undefined
this.requestUpdate()
}
}

handleDeleteItemClick(index: number) {
if (this.value) {
this.value.splice(index, 1)
this.handleInlangProjectChange(this.value, this.property, this.moduleId)
this._inputValue = "null"
this._inputValue = undefined
this.requestUpdate()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,17 @@ export class LanguageTagsInput extends LitElement {
if (this._inputValue && this._inputValue.trim() !== "") {
this.value ? this.value.push(this._inputValue) : (this.value = [this._inputValue])
this.handleInlangProjectChange(this.value, this.property, this.moduleId)
this._inputValue = "null"
this._inputValue = undefined
this.requestUpdate()
}
}

handleDeleteItemClick(index: number) {
if (this.value) {
this.value.splice(index, 1)
this.handleInlangProjectChange(this.value, this.property, this.moduleId)
this._inputValue = "null"
this._inputValue = undefined
this.requestUpdate()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,21 @@ export class DefaultObjectInput extends LitElement {
}
this.value[this._inputKey as any] = this._inputValue
this.handleInlangProjectChange(this.value, this.property, this.moduleId)
this._inputValue = "null"
this._inputValue = undefined
this._inputKey = "null"
this._inputKey = undefined
this.requestUpdate()
}
}

handleDeleteItemClick(key: InlangModule["default"]["id"]) {
if (this.value) {
delete this.value[key]
this.handleInlangProjectChange(this.value, this.property, this.moduleId)
this._inputValue = "null"
this._inputValue = undefined
this._inputKey = "null"
this._inputKey = undefined
this.requestUpdate()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ export class LintRuleLevelObjectInput extends LitElement {
) => {
//TODO: workaround because select field was not updating
setTimeout(() => {
this.requestUpdate()
const _value = this.value
this.value = {}
this.value = _value
})
if (value && Object.keys(value).includes(id)) {
return value[id]
Expand Down

0 comments on commit 4f9cc6b

Please sign in to comment.