reactioncommerce / reaction

Mailchimp Open Commerce is an API-first, headless commerce platform built using Node.js, React, GraphQL. Deployed via Docker and Kubernetes.
https://mailchimp.com/developer/open-commerce/
GNU General Public License v3.0
12.34k stars 2.17k forks source link

Multiple instances of Components.Login causes a browser warning because ids are identical #4043

Closed prinzdezibel closed 6 years ago

prinzdezibel commented 6 years ago

Prerequisites

Issue Description

If the DOM contains two instances of the Login component a browser warning appears in the console:

[DOM] Found 2 elements with non-unique id #email-6uGr7m9g6jznnXKFD: (More info: https://goo.gl/9p2vKq) <input type=​"email" class=​"email-edit-input" name=​"email" placeholder value id=​"email-6uGr7m9g6jznnXKFD">​ <input type=​"email" class=​"email-edit-input" name=​"email" placeholder value id=​"email-6uGr7m9g6jznnXKFD">​

Steps to Reproduce

  1. Put this code snippet into plugins/core/accounts/client/components/mainDropdown.js, line 127
          <div className="accounts dropdown" role="menu">
            {this.renderSignInComponent()}
            {this.renderSignInComponent()}
          </div>
  2. Start reaction
  3. Navigate to landing page with browser console open

Versions

Node: 8.2.1 NPM: 5.3.0 Meteor Node: 8.9.4 Meteor NPM: 5.6.0 Reaction CLI: 0.26.4 Reaction: 1.9.0 Reaction branch: master Docker: 17.03.1-ce

prinzdezibel commented 6 years ago

Closed via https://github.com/reactioncommerce/reaction/pull/4044.