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

Consider add portal-tag-name support to PortForComponent #6

Open
foxnewsnetwork opened this issue Mar 22, 2016 · 1 comment
Open

Consider add portal-tag-name support to PortForComponent #6

foxnewsnetwork opened this issue Mar 22, 2016 · 1 comment

Comments

@foxnewsnetwork
Copy link

The Proposition

Consider changing the code at:

https://github.com/minutebase/ember-portal/blob/master/addon/components/portal-for.js#L9

to something like:

'portal-tag-name': 'div',
portalElement() {
  const elementID = portalIdForName(this.get("name"));
  let element = document.getElementById(elementID);

  if (!element) {
    element = document.createElement(this.get('portal-tag-name'));
    element.id = elementID;
  }

  return element;
},

The Reason

This will allow users to customize the element tag name of the created portal, which is particularly useful for yielding into lists, spans, and other such elements

@rlivsey
Copy link
Member

rlivsey commented Mar 22, 2016

👍 I'd quickly merge a PR which added this with a test.

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

No branches or pull requests

2 participants