Skip to content
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

关于m2m_transfer需要再点一下的bug #711

Open
RyanLoil opened this issue Mar 24, 2020 · 1 comment
Open

关于m2m_transfer需要再点一下的bug #711

RyanLoil opened this issue Mar 24, 2020 · 1 comment

Comments

@RyanLoil
Copy link

RyanLoil commented Mar 24, 2020

已经找到问题所在,并提供解决方案,就一个小修改。
xadmin.widget.select-transfer.js
第172行修改为:
box.options[i].selected = true;
然后在第72行前添加:
if (box == this.to_box) { this.to_box[0].options[0].selected = true; };
修复的bug是必须点击一下右侧选中框才能提交这个问题。
没能找到具体的原因,但是发现修改HTML的option标签的selected属性为true(任意一个就行)就能处理这个问题,索性在显示的时候直接显示第一个为select就绕开它了。

@xingzybj
Copy link

xingzybj commented Sep 7, 2020

赞 解决了我的问题
只有添加一个option 可以自动选中
做了一点点修改 72行代码 修改如下:
if (box == this.to_box) { this.to_box[0].options[i].selected = true; };
这样添加多个option 都可以自动选中 完美解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants