Comments (6)
You're still recreating the modal, you have to change the setting:
$("#janela_mensagem").modal("setting", "closable", true);
https://jsfiddle.net/67a9kyj8/
from fomantic-ui.
Now I understood what you said! I was being stupid, I was not understanding how the logic worked! Now I do: if I need to change settings on an already opened modal, I need to use setting
. Thank you so much for your patience with me !
from fomantic-ui.
If you call modal(), given an object as first parameter, on the same element, you are always recreating the modal. It gets even worse when the modal is already in progress (shown). That's the reason for the console error, because it expects internal variables which are created once the modal is shown. But as you are recreating the modal while it is shown, the internal variables get reset to undefined, causing the console error.
That said, It's not a bug.
So, if you need to recreate the modal, you can do so as many times as you want, but make sure the modal is hidden/closed.
If you only need to change some internal setting at runtime, use the setting
behavior (this works also when the modal is in progress/shown)
from fomantic-ui.
@batata004 Here you are :)
https://jsfiddle.net/lubber/gv6sudry/
You can change onHide
while the modal is shown, but only via the setting
behavior (which i explained in the other thread)
from fomantic-ui.
In some cases, I really want to recreate the modal because I want all the other settings reverted to default (for example, I may have set onHide
event and now I want to set closable
to true
at the same time that all the other events/settings get reverted to the default).
Yet, this is still a bug, right? Because I call modal
twice, but at the second time some settings (like closable
) are not setted correctly. Or is it prohibited to call modal
twice on the same element?
from fomantic-ui.
@lubber-de @GammaGames So here is exactly my problem: I already opened a modal (it's already showing to the user). Now I need to change the onHide
event. As you said in another thread, I cant change onHide
after the modal is already showed and I also cant change onHide
using setting
feature. So how I change the onHide
after I already opened the modal?
In my specific case, I showed the modal to the user and after the user interact with it (filling a form) I want the onHide
event to be different depending on the answers the user provided in the form inside the modal.
So how do I change the onHide
event after the modal is already displayed? I was trying to make a hack
with closable
but it didnt work, so I am back to the square 0.
from fomantic-ui.
Related Issues (20)
- nag('dismiss') throws error HOT 1
- [Dropddow] Items are not updated when remove manually HOT 2
- [Dropdown] render is very slow with large dataset HOT 2
- [Scrollbar] CSS style for Firefox scrollbar break the scrollbar on chromium browser (Chrome/ Edge) HOT 2
- [Dropdown] Using serialized JSON as value prevent the select value from being updated. HOT 1
- [scope] npm install deprecated and security warnings HOT 5
- [form validation] keyHeldDown conflicting behavior HOT 3
- [message] Link color doesn't match message color HOT 6
- [dropdown] ui simple dropdown does not work on mobiles HOT 2
- [bug] `closable` modal set to false is still closing HOT 7
- [menu] Menu is rendered outside viewport HOT 3
- [dropdown] JS error when typing if dropdown open HOT 2
- [calendar] incorrect day shown when startMode changed from "month" to "hour" HOT 7
- [dropdown] Height variation is not working HOT 1
- [Cards] Even column count cards bug HOT 7
- [dropdown] clearable multiple search selection dropdown HOT 2
- [dropdown] inline validation on submit HOT 1
- [dropdown] add behavior to sort a dropdown list HOT 1
- [Dropdown] dropdown with multiple selection search clearable class not showing cursor HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fomantic-ui.