Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Prefix instance id when custom node id is passed #325

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mrchief
Copy link
Collaborator

@mrchief mrchief commented Jan 19, 2020

What does it do?

When a user defined node id is specified, it is used instead of an autogenerated on. When the same data is used across multiple components on the same page, this results in duplicate HTML Ids for tags, tag remove buttons.

Fixes # (issue)

Fixes #315

Also fixes an unreported bug where removing tags by backspace doesn't correctly fire onTagRemove event.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [n/a] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [n/a] This change requires a documentation update

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • [n/a] Updated documentation (if applicable)
  • Added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • My changes generate no new warnings

*
*/
export default class Node {
constructor({ depth, rootPrefixId, parent, index, ...dataProps }) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.

src/index.js Show resolved Hide resolved
@stale
Copy link

stale bot commented Feb 18, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 18, 2020
@mrchief mrchief added wip Work In Progress and removed stale labels Feb 18, 2020
@mrchief
Copy link
Collaborator Author

mrchief commented Mar 29, 2020

@ellinge @Nogias9x Is this good to go?

@ellinge
Copy link
Collaborator

ellinge commented Mar 29, 2020

@mrchief the change on the resolved conversation should be reverted? Or was that another change that was needed?

@mrchief
Copy link
Collaborator Author

mrchief commented Mar 29, 2020

@mrchief the change on the resolved conversation should be reverted? Or was that another change that was needed?

Yeah it should be. It's been a while so let me take a deep dive.

@codeclimate
Copy link

codeclimate bot commented Jun 19, 2020

Code Climate has analyzed commit 588d40c and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Bug Risk 1

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wip Work In Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"x" buttons have same id in HTML DOM
2 participants