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

[placeholder] allow for omission of certain attributes on placeholder clone #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tony-kerz
Copy link

if placeholder clone includes data-reactid attributes, react will throw:

Uncaught Error: Invariant Violation: ReactMount: Two valid but unequal nodes with the same `data-reactid`: .0.0.0.0

this fix allows for a call syntax like below which will omit data-reactid attributes and skirt error:

  componentDidMount() {
    console.log('menu: cdm')
    $(React.findDOMNode(this)).visibility(
      {
        type: 'fixed',
        omitPlaceholderAttrs: 'data-reactid'
      }
    )
  }

… clone

there is an issue with cloning out data-reactid attributes on placeholder
@jlukic
Copy link
Member

jlukic commented Jul 26, 2015

I understand, let me consider the best way to handle this. I think this is a little 'brute force'.

All PR changes need to be merged into main repo semantic-org/semantic-ui, this repo is automatically generated

@tony-kerz
Copy link
Author

thanks jack,

yeah, i'm kind of an intermediate front-end brute,
so i'm down with any solution you approve of that skirts that issue.

best,
tony.

On Sun, Jul 26, 2015 at 1:01 PM, Jack Lukic notifications@github.com
wrote:

I understand, let me consider the best way to handle this. I think this is
a little 'brute force'


Reply to this email directly or view it on GitHub
#1 (comment)
.

@jwdomingo
Copy link

@tony-kerz, if this is still relevant to you, I just ran into problem while using the Dropdown module. I was able to prevent it by adding data-text attributes to each item in the dropdown menu. This makes it so that the elements within the tag are not cloned but rather a new element is mounted as the placeholder so React makes a new ID. Hope that helps!

Check out Specifying Different Text & Hidden Input Values

@eyalw
Copy link

eyalw commented Jul 24, 2016

Hey, you think this will be solved with React 15 removing data-reactId from the DOM?

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

Successfully merging this pull request may close these issues.

None yet

4 participants