question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[NodeJS][HTML] [Duplicate HTML ids]

See original GitHub issue

Platform

What platform is your issue or question related to? (Delete other platforms).

  • .NET HTML
  • .NET WPF
  • Android
  • iOS
  • JavaScript
  • UWP

Author or host

Host

If you’re an author, who are you sending cards to?

Version of SDK

2.7.0

Details

We’ve been looking at a way to be able to allow focus on a particular input element when a card has been loaded. We were going to do this by providing an id and then using document.getElementById() to get the item and call focus() on it, but we’ve run into an issue where the renderer is applying the provided id to the input item, but also to the container div around it.

Because the HTML guidance is all ids should be unique, calling document.getElementById() will only ever get the first item it finds, which in the case of the adaptive card is the containing div, and not the input.

Is this a bug? If not, what was the reasoning behind breaking HTML guidance for this?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jonmillcommented, Apr 29, 2021

@jankratochvilcz - We’re trying to get to it in May but we aren’t 100% positive that it will fit yet. If you’re willing or able to, we’d welcome you contributing the fix! 😃

0reactions
jonmillcommented, May 4, 2021

No problem, I appreciate the follow-up and am glad you got everything working

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why are duplicate ID values not allowed in HTML?
So if you use duplicate ids in your HTML many libraries will not work as expected. The most libraries will get the first...
Read more >
Node: cloneNode() method - Web APIs - MDN Web Docs
Warning: cloneNode() may lead to duplicate element IDs in a document! If the original node has an id attribute, and the clone will...
Read more >
HTML DOM Element cloneNode Method
The cloneNode() method creates a copy of a node, and returns the clone. The cloneNode() method clones all attributes and their values. Set...
Read more >
How to copy or clone an element with vanilla JS
cloneNode() method to create a copy. You call the cloneNode() method on the element you want to copy. If you want to also...
Read more >
CloneNode() method in JavaScript
The cloneNode() method in JavaScript makes a duplicate of the node object that is sent in and delivers the clone node object. On...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found