1

我最近将 Actiontext 配置为在我的 Rails 6.0.0 应用程序上工作。一切正常,除了我的应用程序的 Actiontext 编辑器中的图像每次我按 Enter 进入新行时都会闪烁。可以参考下面的视频。

https://imgur.com/76QuZyW

我不确定如何解决这个问题。会不会是配置错误的 Actiontext 或 ActiveStorage?


编辑:

这是我的代码,

//  javascript/packs/application.js
require("trix")
require("@rails/actiontext")


/*  assets/stylesheets/application.scss */
//=require actiontext


/*  assets/stylesheets/actiontext.scss */
@import "trix/dist/trix";

.trix-content {
  .attachment-gallery {
    > action-text-attachment,
    > .attachment {
      flex: 1 0 33%;
      padding: 0 0.5em;
      max-width: 33%;
    }

    &.attachment-gallery--2,
    &.attachment-gallery--4 {
      > action-text-attachment,
      > .attachment {
        flex-basis: 50%;
        max-width: 50%;
      }
    }
  }

  action-text-attachment {
    .attachment {
      padding: 0 !important;
      max-width: 100% !important;
    }
  }
}

# app/models/card.rb
class Card < ApplicationRecord

  has_rich_text :answer

end


<%# app/views/cards/_form.html.erb %>
  <div class="form-group">
    <%= f.label :answer %>
    <%= f.rich_text_area :answer %>
  </div>  
4

1 回答 1

1

6.0.0.rc1在我从 升级到后问题就消失了6.0.3

升级还升级了其他宝石。其中一些我认为是罪魁祸首:

-    rails (6.0.0)
-      actioncable (= 6.0.0)
-      actionmailbox (= 6.0.0)
-      actionmailer (= 6.0.0)
-      actionpack (= 6.0.0)
-      actiontext (= 6.0.0)
-      actionview (= 6.0.0)
-      activejob (= 6.0.0)
-      activemodel (= 6.0.0)
-      activerecord (= 6.0.0)
-      activestorage (= 6.0.0)
-      activesupport (= 6.0.0)
+    rails (6.0.3)
+      actioncable (= 6.0.3)
+      actionmailbox (= 6.0.3)
+      actionmailer (= 6.0.3)
+      actionpack (= 6.0.3)
+      actiontext (= 6.0.3)
+      actionview (= 6.0.3)
+      activejob (= 6.0.3)
+      activemodel (= 6.0.3)
+      activerecord (= 6.0.3)
+      activestorage (= 6.0.3)
+      activesupport (= 6.0.3)
于 2020-05-11T13:08:00.020 回答