Skip to content

Commit

Permalink
Fix in related elements dublicate 'id' in elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Aglok committed Sep 28, 2020
1 parent 259a2c5 commit 1bef526
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,8 @@
<p align="center"><h2>[Unreleased] (Only in SleepingOwl <code class="language-php">8+</code> branch)</h2></p>

## 2020-09-28
* [Fix] Fix in related elements dublicate 'id' in elements

## [RELEASED 8.2] 2020-09-25
* [Fix] Fix in related elements don't set method setDefaultValue()

Expand Down
8 changes: 8 additions & 0 deletions resources/assets/js_owl/admin/form/related/group.js
Expand Up @@ -35,6 +35,14 @@ Vue.component('related-group', {
},

mounted() {

each(this.$el.querySelectorAll('input, select'), (el) => {
const id = el.getAttribute('id');
if (id) {
el.setAttribute('id', `${id}_${this.index}`);
}
});

if (!this.primary) {
each(this.$el.querySelectorAll('input, select'), (el) => {
const name = el.getAttribute('name');
Expand Down

0 comments on commit 1bef526

Please sign in to comment.