我正在尝试以simple_form实现下拉列表,但是电子邮件集合显示在主框的后面。参见下图:
我已经尝试过使用z-index,但是失败了。我还尝试根据有关常见问题(https://select2.org/troubleshooting/common-problems)的select2文档添加一些javascript代码,但也失败了。
Ruby苗条代码是:
.reveal id="doubt-material-#{material.id}" data-reveal=true
= simple_form_for [:student,trail,component,material,material_student,doubt],html: { id: "doubt" },remote: true do |f|
= f.input :recipient,:collection => %w[contato@witseed.com suporte@witseed.com],label: "#{t 'students.materials.index.questions.form_send_email'}",include_blank: "#{t 'students.materials.index.questions.form_blank_line'}"
javascript:
$('#select2-doubt_recipient-container').select2({
dropdownParent: $('#doubt-material-#{material.id}')
});
HTML是:
有人知道发生了什么吗?
谢谢。