-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Tab] Cached content is added back on each open (losing changes) #2534
Comments
Docs list the wrong name for the setting, it should be |
Basically response is cached before The actual fix will have to be more involved. I've marked this for a later release. |
…inal response so that execution occurs in same way each load. HTML caches final html content after callbacks
I've added a new setting Response will cache the original response so that it can be played back identically on future callbacks (current behavior), You will have to now call with |
@andreyvk I'm really sorry how long it took me to address this. Fiddle example from |
@jlukic Thanks. I've tested on a fiddle, but i think we still have the same issue. Here's fiddle: http://jsfiddle.net/andreyvk/zjqxxmoj/ Maybe I cant get configuration right? The idea is very simple:
|
Hi @jlukic Thanks |
Hi @jlukic, We would like to sponsor this fix so you could roll it out. We are getting a lot of complains regarding our product primarily because we are not being able to make some tabs load only once and then remain unchanged afterwards. Do you think you can find some time to look into this asap? |
Yeah @andreyvk if this is important to you I can put a fix in this week. If you want to reach out by gchat feel free to hit me up at [email protected], but I think I have a clear test case. I've just been slowed down lately by increasing personal / work obligations. |
@jlukic , unfortunately this is very important at the moment. I've been waiting for this fix like a kid is waiting for Christmas. It's actually becoming a huge inconvenience for our clients. Just as a reminder on this issue:
Thanks for your email address (!), but I wont be bothering you there. I just sincerely hope you can find time to fix this one :) |
Meanwhile you can try delegation: $('body').on('click', 'button', function() { alert(1) }); |
I think using If this isnt correct, please let me know the expected response, so I can consider changes to the component. |
If you click on the "First" tab more than once you would notice that time (in ms) is changing. Which means that JS is fired again and again every time tab is selected. This isn't the correct/desired behavior. Tab must be loaded and JS "ready" fired only once. Thanks for this! Really ) |
I see what you mean, I'll add something |
Hey @andreyvk thanks for your patience. I've added a new cache type This should have the effect you're looking for Example: |
Thanks for the hard work! But im sorry to say, that the fix that you provided did not work though... I found that all
Sorry for misunderstanding. I should've told you before, but I had no idea that you'd be taking this approach in tackling the issue. May I ask why you always need to clone/re-insert html, when tab is clicked on? Technically what's needed is to only make tab content visible, because it was hidden on the first place. |
Hi @jlukic |
I've added a "loadOnce" setting which will only call remote endpoint on
first load.
https://github.com/Semantic-Org/Semantic-UI/commit/
0302ae9
And JSfiddle
http://jsfiddle.net/wfe67tog/
…On Tue, Nov 1, 2016 at 5:40 PM, usef911 ***@***.***> wrote:
Hi @jlukic <https://github.com/jlukic>
Any updates? Appreciate the hard work very much.
Thanks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2534 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABaU1VJhP_zuTcSTy-oTuoXjiEeNQINks5q57HpgaJpZM4FTTx3>
.
|
@jlukic that actually looks great! thanks a lot and happy NY! Btw, any idea when can we expect 2.2.8 release? |
@jlukic How are you? Any updates on the next bug fix release? |
* 'master' of https://github.com/Semantic-Org/Semantic-UI: (24 commits) Fix build scripts to work again Date Fix autoinstall breaks when param used after git clone of repo (no package manager) Builds 2.2.7 Update versions Build 2.2.6 Hotfix for typo Fixes let usage Update RELEASE-NOTES.md Build 2.2.5 Add missing checkbox var Build dist Adds missing checkbox variables Semantic-Org#2534 release notes Semantic-Org#2534 - adds new DOM caching, which preserves events and final rendered state Add CDNJS version badge in README.md Update checkbox.less Fix bug in search related to DOM fragment removed from document Adds container option for sticky, adds checkbox vars Transition can now read final display state from metadata ...
@Banandrew hi. Do you have any idea of when the next release is gonna be? Or at least where I could monitor that info? Our app heavily relies on SUI and some enhancements (like this one) are crucial to us. We are really looking forward for this enhancement. |
Hi @andreyvk, Jack’s currently splitting his time between NY & SF working with a SUI company, and will return working on SUI development full-time sometime in the near future, but exactly when is unknown . My advice to you, is to see if you can implement the commit above in your SUI copy until 2.2.8 arrives. Sorry, I wish I could give you a better answer. |
@Banandrew, I was there when he left for work )) Pity that it takes so long though... SUI is crazy important to us. In any case, i guess that I'd have to try and do manual merge like you suggested. Cheers! |
Hey @andreyvk I'm going to release this later tonight. I know it's been annoying to wait. |
@jlukic that's great news! Really looking forward to that! |
I still don't understand cacheType='html' or its is broken when using apiSettings. I'm using semantic-ui 2.2.9 and the tab is rebuild every-time (User Inputs and item-state is lost on tab change). I would think using cacheType='html' would load tabs only once from the server and then simply change the visibility of tabs without doing anything in the DOM. I use the following workaround, which currently solves all my problems:
The Content is loaded once and then just stays in the DOM. So User-Inputs stay when the tab is changed (because the other content is just hidden) |
Hi,
I've just upgraded to Semantic 2.0.0. Great job on this one! Thanks @jlukic
I have dynamically opened tabs in my app, contents of which are AJAXed by semantic and normally include HTML and
<script>
tags. On the first load of any tab everything seems to execute well and work well too, however if tab is clicked on again or focused back on, all the dynamically generated elements are lost (i.e. as if html content is re-inserted but javascript never fires).Here's a fiddle
Question: It might be a correct behavior in some cases, but how can I make tabs evaluate the content trully once, so that when user goes back to a tab, everything remains as it was? For that matter
evaluateScripts: true
wouldn't work for me either.PS: the Tab/Settings documentation lists a
parseScripts
parameter. Shouldn't it beevaluateScripts
instead?The text was updated successfully, but these errors were encountered: