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

Can't add youtube with bootstrap #1373

Closed
startong21 opened this issue Nov 26, 2018 · 7 comments
Closed

Can't add youtube with bootstrap #1373

startong21 opened this issue Nov 26, 2018 · 7 comments
Assignees
Labels
package:media-embed type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@startong21
Copy link

Is this a bug report or feature request? (choose one)

🐞 Bug report

💻 Version of CKEditor

https://cdn.ckeditor.com/ckeditor5/11.1.1/classic/ckeditor.js

📋 Steps to reproduce

  1. I use the following Bootstrap CDN(http://getbootstrap.com/)'s CSS, JS, Popper.js, and jQuery. This is default links in Bootstrap CDN.
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity_no="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity_no="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity_no="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>

I can't add any youtube videos on CKEditor5 editor.

  1. If I remove the bootstrap.min.css from my site source, I can add youtube videos.

✅ Expected result

youtube video

❎ Actual result

no video

📃 Other details that might be useful

@Reinmar
Copy link
Member

Reinmar commented Nov 26, 2018

Hi! Could you create a sample on e.g. JSFiddle on which we could reproduce this issue?

@programad
Copy link

programad commented Dec 5, 2018

I am having this problem too. Confirmed not working with bootstrap 4.1.3

Looks like both ckeditor and bootstrap4 use the class .media. Bootstrap sets it to display:flex. Overriting it with display:block fixes the problem (maybe)

@Reinmar
Copy link
Member

Reinmar commented Dec 5, 2018

See #1391 (comment). Apparently Bootstrap sets some styles for .media which breaks the media widgets in CKEditor 5. If you'd style .ck-content .media { height: (not sure what here) }, the problem should be resolved.

cc @oleq

@programad
Copy link

@Reinmar display:block works too.

@dkonopka
Copy link
Contributor

dkonopka commented Dec 7, 2018

Yes, it's true bootstrap 4 overwrites .media class.

https://github.com/twbs/bootstrap/blob/v4-dev/scss/_media.scss#L1-L4

ATM it's easy to fix it with with stronger CSS Specificity:

.ck-content .media {
  display: block;
}

Anyways we could introduce this fix by default in our ckeditor5-media-embed CSS.

@startong21
Copy link
Author

Thank you!

@oleq oleq added type:bug This issue reports a buggy (incorrect) behavior. status:confirmed package:media-embed and removed status:pending labels Dec 18, 2018
oleq added a commit to ckeditor/ckeditor5-media-embed that referenced this issue Dec 18, 2018
Fix: Media embed figures should have `display: block` in the content styles to prevent Bootstrap from changing their appearance. Closes ckeditor/ckeditor5#1373.
@linucle
Copy link

linucle commented Aug 28, 2019

In my webpage doesn't work...

<figure class="media"><oembed url="https://www.youtube.com/watch?v=H08tGjXNHO4"></oembed></figure>

we can't see the movie. (by this tag)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:media-embed type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

6 participants