{"action":"created","issue":{"url":"https://api.github.com/repos/jiripudil/Naja/issues/21","repository_url":"https://api.github.com/repos/jiripudil/Naja","labels_url":"https://api.github.com/repos/jiripudil/Naja/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/jiripudil/Naja/issues/21/comments","events_url":"https://api.github.com/repos/jiripudil/Naja/issues/21/events","html_url":"https://github.com/jiripudil/Naja/issues/21","id":394595002,"node_id":"MDU6SXNzdWUzOTQ1OTUwMDI=","number":21,"title":"Working with snippet containers","user":{"login":"dakur","id":9862581,"node_id":"MDQ6VXNlcjk4NjI1ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/9862581?v=4","gravatar_id":"","url":"https://api.github.com/users/dakur","html_url":"https://github.com/dakur","followers_url":"https://api.github.com/users/dakur/followers","following_url":"https://api.github.com/users/dakur/following{/other_user}","gists_url":"https://api.github.com/users/dakur/gists{/gist_id}","starred_url":"https://api.github.com/users/dakur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dakur/subscriptions","organizations_url":"https://api.github.com/users/dakur/orgs","repos_url":"https://api.github.com/users/dakur/repos","events_url":"https://api.github.com/users/dakur/events{/privacy}","received_events_url":"https://api.github.com/users/dakur/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-12-28T09:46:12Z","updated_at":"2018-12-28T15:35:17Z","closed_at":null,"author_association":"NONE","body":"From quick look into [source code](https://github.com/jiripudil/Naja/blob/1.5.1/src/core/SnippetHandler.js) it seems that Naja snippet rerendering is built on principle \"let's see what IDs came from server, check if they exist in DOM and do an update\". That's fine until you have static snippet container with dynamic snippets inside and some of them should be removed when AJAX request is finished.\r\n\r\nLet's take an example of page with feedbacks - you know...\r\n![image](https://user-images.githubusercontent.com/9862581/50511200-e4b0c500-0a8c-11e9-8407-93f33310e879.png)\r\n\r\nWhen you hit the toggle button, request is sent to backend and the selected feedback is marked as resolved. Once resolved, it should be hidden from the unresolved feedback list. Nette invalidates controls and list with only one feedback is returned, but Naja only updates this one returned element and the rest is untouched.\r\n\r\nI'd say it should be aware of dynamic snippets and their dynamics somehow."},"comment":{"url":"https://api.github.com/repos/jiripudil/Naja/issues/comments/450378038","html_url":"https://github.com/jiripudil/Naja/issues/21#issuecomment-450378038","issue_url":"https://api.github.com/repos/jiripudil/Naja/issues/21","id":450378038,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDM3ODAzOA==","user":{"login":"matej21","id":1276059,"node_id":"MDQ6VXNlcjEyNzYwNTk=","avatar_url":"https://avatars2.githubusercontent.com/u/1276059?v=4","gravatar_id":"","url":"https://api.github.com/users/matej21","html_url":"https://github.com/matej21","followers_url":"https://api.github.com/users/matej21/followers","following_url":"https://api.github.com/users/matej21/following{/other_user}","gists_url":"https://api.github.com/users/matej21/gists{/gist_id}","starred_url":"https://api.github.com/users/matej21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matej21/subscriptions","organizations_url":"https://api.github.com/users/matej21/orgs","repos_url":"https://api.github.com/users/matej21/repos","events_url":"https://api.github.com/users/matej21/events{/privacy}","received_events_url":"https://api.github.com/users/matej21/received_events","type":"User","site_admin":false},"created_at":"2018-12-28T15:35:17Z","updated_at":"2018-12-28T15:35:17Z","author_association":"NONE","body":"and are you sure you need dynamic snippets? usage for dynamic snippets is that you have a list of items and you want to redraw just one of them. then you send to the template only that and rest of items stays untouched.\r\n\r\nif you remove `n:snippet=\"feedback-{$feedback->id}\"` then it will behave like \"normal\" snippets and feedback snippet will be send to a browser as a single item. \r\n\r\nOr if you really need dynamic snippets then add some `{snippet feedbackWrapper}` and invalidate this one.\r\n\r\nyou can check my talk about snippets https://www.youtube.com/watch?v=CoXJnOCRQ70 (czech only)\r\n"}}
{"actor":{"display_login":"matej21"}}