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

Menu's have non-component children #3612

Closed
nickygerritsen opened this issue Sep 14, 2016 · 4 comments
Closed

Menu's have non-component children #3612

nickygerritsen opened this issue Sep 14, 2016 · 4 comments
Labels
pinned Things that stalebot shouldn't close automatically

Comments

@nickygerritsen
Copy link

nickygerritsen commented Sep 14, 2016

Both the default menu-button (https://github.com/videojs/video.js/blob/master/src/js/menu/menu-button.js) and the chapters button (https://github.com/videojs/video.js/blob/master/src/js/control-bar/text-track-controls/chapters-button.js) (might) add a <li> to the children_ array of a menu, while I think children of Components should all be a Component. We can (probably) fix this by creating something like a MenuItemTitle component.

@misteroneill
Copy link
Member

I am on board with the idea that we should be able to expect the contents of children_ to be components.

Probably wouldn't even need a custom component - unless it's doing something beyond what a generic component does - it could create the el and pass it as an option to a generic component.

Perhaps generic components should be able to take a DOM configuration to make this easier? Something like:

new Component(this, {
  dom: {
    tagName: 'li',
    props: {},
    attrs: {}
  }
});

@nickygerritsen
Copy link
Author

That does sound like a good idea IMHO :).

@misteroneill
Copy link
Member

misteroneill commented Sep 23, 2016

Or it could be an array to match the Dom.createEl arguments: dom: ['li', {}, {}, /* child content */].

@nickygerritsen
Copy link
Author

Yeah that'd make even more sense I guess, then we can just pass it to that function

@gkatsev gkatsev added the pinned Things that stalebot shouldn't close automatically label Jul 2, 2018
chrisboustead added a commit to chrisboustead/videojs-hls-quality-selector that referenced this issue Jan 3, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pinned Things that stalebot shouldn't close automatically
Projects
None yet
Development

No branches or pull requests

3 participants