marmelab / marmelab/ng-admin

Duplicate id on embedded list fields

Open
#981 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
3.9k
Forks
703
PR merge metrics
No merged PRs in 30d

Description

Hello,

While writing some Selenium test I realised then when ng-admin is unwrappring an embedded-list type it is always using the configured field name to attribute the id value in the DOM.
This results in duplicate id name in the DOM.

So for instance for an embedded list returning a key field we ene dup with a dom like like :

```



Key * 






```

Where id="row-key" is assigned by the ma-field directive (as far as I can tell), and then the

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the ma-field directive and its handling of embedded-list fields, using the DOM example in the issue as the reproduction. Check how the configured field name becomes the input id and how the embedded item index could be included. Done means multiple embedded items no longer produce duplicate input ids, as verified in a Selenium test.

Written by the indexing model from the issue text.

Assessment

Tech stack
angularjs, javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.