Bootstrap dropdown not working after close bootstrap modal in razor
My Bootstrap dropdown not working after close bootstrap modal.
Modal:
<span class="btn btn-warning btn-sm col-xs-offset-5 col-xs-1"
id="backFromEdit" data-dismiss="modal">
✘
</span>
dropdown:
<div class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown">
@User.Identity.GetUserName()
<span class="glyphicon glyphicon-triangle-bottom"></span>
</a>
<ul class="dropdown-menu">
<li>@Html.ActionLink("Manage Account", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })</li>
<li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
</ul>
</div>
The modal contains a partial view and dropdown is in partial view login.
Actually the dropdown starts working on every second time closing the modal(e.g. not working after 1st 3rd 5th close... but work on 2nd, 4th...). Very weird. I came across the same situation if I use .modal('toggle') instead of data-dismiss="modal".
Anyone knows about this?
jquery asp.net-mvc bootstrap-modal bootstrap-4
add a comment |
My Bootstrap dropdown not working after close bootstrap modal.
Modal:
<span class="btn btn-warning btn-sm col-xs-offset-5 col-xs-1"
id="backFromEdit" data-dismiss="modal">
✘
</span>
dropdown:
<div class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown">
@User.Identity.GetUserName()
<span class="glyphicon glyphicon-triangle-bottom"></span>
</a>
<ul class="dropdown-menu">
<li>@Html.ActionLink("Manage Account", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })</li>
<li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
</ul>
</div>
The modal contains a partial view and dropdown is in partial view login.
Actually the dropdown starts working on every second time closing the modal(e.g. not working after 1st 3rd 5th close... but work on 2nd, 4th...). Very weird. I came across the same situation if I use .modal('toggle') instead of data-dismiss="modal".
Anyone knows about this?
jquery asp.net-mvc bootstrap-modal bootstrap-4
You have to clearly state the issue. including a fiddle, will surely help. What isdrop?
– Kumar_Vikas
Dec 26 '17 at 6:29
add a comment |
My Bootstrap dropdown not working after close bootstrap modal.
Modal:
<span class="btn btn-warning btn-sm col-xs-offset-5 col-xs-1"
id="backFromEdit" data-dismiss="modal">
✘
</span>
dropdown:
<div class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown">
@User.Identity.GetUserName()
<span class="glyphicon glyphicon-triangle-bottom"></span>
</a>
<ul class="dropdown-menu">
<li>@Html.ActionLink("Manage Account", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })</li>
<li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
</ul>
</div>
The modal contains a partial view and dropdown is in partial view login.
Actually the dropdown starts working on every second time closing the modal(e.g. not working after 1st 3rd 5th close... but work on 2nd, 4th...). Very weird. I came across the same situation if I use .modal('toggle') instead of data-dismiss="modal".
Anyone knows about this?
jquery asp.net-mvc bootstrap-modal bootstrap-4
My Bootstrap dropdown not working after close bootstrap modal.
Modal:
<span class="btn btn-warning btn-sm col-xs-offset-5 col-xs-1"
id="backFromEdit" data-dismiss="modal">
✘
</span>
dropdown:
<div class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown">
@User.Identity.GetUserName()
<span class="glyphicon glyphicon-triangle-bottom"></span>
</a>
<ul class="dropdown-menu">
<li>@Html.ActionLink("Manage Account", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })</li>
<li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
</ul>
</div>
The modal contains a partial view and dropdown is in partial view login.
Actually the dropdown starts working on every second time closing the modal(e.g. not working after 1st 3rd 5th close... but work on 2nd, 4th...). Very weird. I came across the same situation if I use .modal('toggle') instead of data-dismiss="modal".
Anyone knows about this?
jquery asp.net-mvc bootstrap-modal bootstrap-4
jquery asp.net-mvc bootstrap-modal bootstrap-4
edited Dec 26 '17 at 11:01
DennisL
asked Dec 25 '17 at 23:51
DennisLDennisL
80110
80110
You have to clearly state the issue. including a fiddle, will surely help. What isdrop?
– Kumar_Vikas
Dec 26 '17 at 6:29
add a comment |
You have to clearly state the issue. including a fiddle, will surely help. What isdrop?
– Kumar_Vikas
Dec 26 '17 at 6:29
You have to clearly state the issue. including a fiddle, will surely help. What is
drop?– Kumar_Vikas
Dec 26 '17 at 6:29
You have to clearly state the issue. including a fiddle, will surely help. What is
drop?– Kumar_Vikas
Dec 26 '17 at 6:29
add a comment |
1 Answer
1
active
oldest
votes
It is too late but for someone who comes back to this, this happens when bootstrap.js is bound twice. At times when the parent page has reference to bootstrap.js and the modal as well; in that case the click event is not released to parent page.
refer to... Issue reported earlier
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47972780%2fbootstrap-dropdown-not-working-after-close-bootstrap-modal-in-razor%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It is too late but for someone who comes back to this, this happens when bootstrap.js is bound twice. At times when the parent page has reference to bootstrap.js and the modal as well; in that case the click event is not released to parent page.
refer to... Issue reported earlier
add a comment |
It is too late but for someone who comes back to this, this happens when bootstrap.js is bound twice. At times when the parent page has reference to bootstrap.js and the modal as well; in that case the click event is not released to parent page.
refer to... Issue reported earlier
add a comment |
It is too late but for someone who comes back to this, this happens when bootstrap.js is bound twice. At times when the parent page has reference to bootstrap.js and the modal as well; in that case the click event is not released to parent page.
refer to... Issue reported earlier
It is too late but for someone who comes back to this, this happens when bootstrap.js is bound twice. At times when the parent page has reference to bootstrap.js and the modal as well; in that case the click event is not released to parent page.
refer to... Issue reported earlier
answered Nov 21 '18 at 13:13
user3104116user3104116
489
489
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47972780%2fbootstrap-dropdown-not-working-after-close-bootstrap-modal-in-razor%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You have to clearly state the issue. including a fiddle, will surely help. What is
drop?– Kumar_Vikas
Dec 26 '17 at 6:29