-
Notifications
You must be signed in to change notification settings - Fork 258
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
Wrong styles applied to my layout after installing gem #316
Comments
Not much info provided, Gem/Rails version. Any online example? |
You shouldn't need both of these lines: <%= tinymce_assets %>
<script type="text/javascript" src="/assets/tinymce.js"></script> Just including the call to |
I am having the same issue since using @rails/propshaft |
No online example but I can replicate with a new Rails 8.0.0.beta1 app, the v7.3.0 of this gem and by adding Here's the full Gemfile.lock.
|
This is definitely one where I'll need a reproduction example repo as I've been unable to replicate it myself. I've uploaded my own example to https://github.com/spohlenz/TinyMCERails8 which is working. In spohlenz/TinyMCERails8@5ae3f16 you'll find the code added onto a fresh Rails 8.0.0.beta1 application. |
Hey @spohlenz, thanks for taking the time to reply here. I just created a minimal repo based on the following command and was able to reproduce the issue. As soon as the gem is installed the layout shifts. This is without even using the editor, just by installing the gem and adding the
You can see the "before tinymce" and "after tinymce" commits, and here's how it looks for me. Before: After: |
Looking back again at your original example, I see the line which is the culprit: <%= stylesheet_link_tag :all, "data-turbo-track": "reload" %> I wasn't aware of this feature of Rails, and it definitely seems like an anti-pattern to me, but I can look into it further. In a new Rails 8 app, like in your example command, the same line is generated but with <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %> |
Further digging: that behavior is coming from https://github.com/rails/propshaft/blob/main/lib/propshaft/helper.rb#L21-L23 There doesn't appear to be any way to exclude railtie/engine assets when using |
That's a very nice find, thanks for digging that up! That does indeed fix the issue, guess that's a new Rails 8 thing that needs to be documented, maybe others will stumble upon this discussion. Thanks again for taking the time to maintain this and for investigating this issue! |
I'm running into the issue that as soon as I add
gem 'tinymce-rails'
to my Gemfile and restart my server the existing layout is broken. The only changes I've done are installing the gem and adding this to my head:If I'm removing the gem, everything works again. Is there any known issues with using it combined with Tailwind? That I can see the same style being applied multiple times seems a bit suspicious.
Thanks!
I can see the styles being injected in the header:
MCE styles being loaded:
Lots of styles being applied to the body over and over again:
The text was updated successfully, but these errors were encountered: