【问题标题】:Best in Place Editor Clearing TextArea最佳就地编辑器清除 TextArea
【发布时间】:2015-06-08 21:08:24
【问题描述】:

我正在使用 Best in Place 编辑器在我的 Rails 应用程序中启用内联文本编辑器。

当我单击最佳位置元素时,它会显示一个空文本区域,而不是文本编辑器的当前值。例如,如果我有文本“测试项目”并单击最佳就地编辑器,它会将文本设置为“&nbsp”,但是如果我单击最佳就地区域之外,它会返回到正确的静态文本。

这是该错误的视频: https://youtu.be/xA18Odj47sc

我的代码如下所示:

<%= best_in_place @collection, :name, :type => :textarea, :nil => @collection.name, :sanitize => false, :value => @collection.name %>

这就是页面上呈现的内容:

点击前:

      <span class="best_in_place" id="best_in_place_collection_1_name" data-url="/collections/introduction-to-product-design--3" data-object="collection" data-attribute="name" data-nil="Test Project" data-type="textarea" data-sanitize="false">Test Project</span>

点击后:

<span class="best_in_place" id="best_in_place_collection_1_name" data-url="/collections/introduction-to-product-design--3" data-object="collection" data-attribute="name" data-nil="Test Project" data-type="textarea" data-sanitize="false">
      <form action="javascript:void(0)" style="display:inline">
          <textarea style="min-width: 193px; min-height: 66px; overflow: hidden;"></textarea>
          <div style="position: absolute; display: none; word-wrap: break-word; font-weight: 400; width: 206px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; font-size: 14px; padding: 4px 6px;">&nbsp;</div>  
      </form>
</span>

【问题讨论】:

    标签: javascript jquery ruby-on-rails ruby best-in-place


    【解决方案1】:

    我认为一定有一个错误,因为在我将最好的文本区域简化为:

     <%= best_in_place @collection, :name, :type => :textarea %>
    

    它似乎工作。可能当前设置值有问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多