-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Instead of declaring an ID and hoping that the ID is unique in the application, use guid IDs, to essentially guarantee their uniqueness. This is done in the Dialog component right now. Replicate the technique elsewhere.
adrx-quicknotes/src/scripts/components/Dialog.jsx
Lines 12 to 47 in 42c44a8
| componentWillMount: function() { | |
| // Guarantee ids are unique. | |
| this.setState({ | |
| contentId: !!this.props.message ? mixins.guid() : null, | |
| titleId: !!this.props.title ? mixins.guid() : null | |
| }); | |
| }, | |
| // | |
| // Render methods | |
| // | |
| render: function() { | |
| return ( | |
| <Overlay show={this.props.show}> | |
| <section | |
| aria-describedby={this.state.contentId} | |
| aria-labelledby={this.state.titleId} | |
| className="qn-Dialog" | |
| role="alertdialog"> | |
| {this.renderTitle()} | |
| {this.renderMessage()} | |
| <div className="qn-Dialog-actions"> | |
| <button | |
| className="qn-Dialog-action qn-Button" | |
| onClick={this.handleConfirm}> | |
| {this.props.confirmationButtonLabel || 'Okay'} | |
| </button> | |
| <button | |
| className="qn-Dialog-action qn-Button" | |
| onClick={this.handleCancel}> | |
| {this.props.cancelButtonLabel || 'Cancel'} | |
| </button> | |
| </div> | |
| </section> | |
| </Overlay> | |
| ); | |
| }, |
Metadata
Metadata
Assignees
Labels
No labels