我正在研究Rails项目。我必须添加一个表情符号选择器。我正在使用此库emoji picker
我的application.erb.html是
<p class="modal-content">
<%= simple_form_for current_user, locals:{ controller: :dashboards ,action: :update } do |f| %>
<p class="emoji-picker-container">
<%= f.text_field :mood, data: { emojiable: true }, maxlength: 3, required: 'required', disabled: 'disabled' %>
<%= f.hidden_field :mood_date, value: DateTime.now.to_date %>
</p>
<%= f.button :submit , value: t('button.submit') %>
<% end %>
</p>
内联脚本:
<script>
$(function() {
// Initializes and creates emoji set from sprite sheet
window.emojiPicker = new EmojiPicker({
emojiable_selector: '[data-emojiable=true]',
assetsPath: 'http://onesignal.github.io/emoji-picker/lib/img/',
popupButtonClasses: 'fa fa-smile-o'
});
window.emojiPicker.discover();
});
</script>
但是问题在这里,我希望没有流行音乐会出现,表情符号框会被修复如下: