Skip to content

Commit

Permalink
fix case when parent value is also fetched, fix #122
Browse files Browse the repository at this point in the history
  • Loading branch information
mskocik committed Sep 9, 2022
1 parent 183b5dd commit e41282a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions component.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,10 @@ class SvelecteElement extends HTMLElement {
if (!this.parent.value && this.svelecte) {
return;
};
if (this.parent.value) {
const parentValue = this.parent.value || this.parent.getAttribute('value'); // for 'fetch'ed parent, value is always null
if (parentValue) {
props.disabled = false;
props.fetch = this.getAttribute('fetch').replace('[parent]', this.parent.value);
props.fetch = this.getAttribute('fetch').replace('[parent]', parentValue);
} else {
delete props['fetch'];
props.disabled = true;
Expand Down

0 comments on commit e41282a

Please sign in to comment.