682 search results

// ... lines 1 - 4
export default class extends Controller {
// ... lines 6 - 8
connect() {
document.addEventListener('turbo:before-fetch-response', this.beforeFetchResponse);
}
// ... lines 12 - 17
beforeFetchResponse(event) {
if (!this.modal || !this.modal._isShown) {
return;
}
const fetchResponse = event.detail.fetchResponse;
if (fetchResponse.succeeded && fetchResponse.redirected) {
event.preventDefault();
Turbo.visit(fetchResponse.location);
}
}
}
See Code Block in Script
// ... lines 1 - 3
export default class extends Controller {
// ... lines 5 - 7
connect() {
this.element.addEventListener('turbo:submit-end', (event) => {
console.log(event);
});
}
// ... lines 13 - 17
}
See Code Block in Script
// ... lines 1 - 3
export default class extends Controller {
// ... lines 5 - 7
connect() {
this.element.addEventListener('turbo:submit-end', (event) => {
console.log(event);
if (event.detail.success) {
this.modal.hide();
}
});
}
// ... lines 16 - 20
}
See Code Block in Script
// ... lines 1 - 4
export default class extends Controller {
// ... lines 6 - 13
disconnect() {
document.removeEventListener('turbo:before-fetch-response', this.boundBeforeFetchResponse);
}
// ... lines 17 - 33
}
See Code Block in Script
// ... lines 1 - 3
export default class extends Controller {
// ... lines 5 - 7
connect() {
document.addEventListener('turbo:before-fetch-response', (event) => {
console.log(event);
if (event.detail.success) {
//this.modal.hide();
}
});
}
// ... lines 16 - 20
}
See Code Block in Script
// ... lines 1 - 3
export default class extends Controller {
// ... lines 5 - 7
connect() {
document.addEventListener('turbo:before-fetch-response', (event) => {
console.log(event);
if (!this.modal || !this.modal._isShown) {
return;
}
const fetchResponse = event.detail.fetchResponse;
if (fetchResponse.succeeded && fetchResponse.redirected) {
event.preventDefault();
this.modal.hide();
}
});
}
// ... lines 22 - 26
}
See Code Block in Script
32 lines | templates/_modal.html.twig
// ... lines 1 - 14
<turbo-frame
class="modal-body"
src="{{ modalSrc }}"
>
{{ modalContent|default('Loading...') }}
</turbo-frame>
// ... lines 21 - 32
See Code Block in Script
With the sudden departure of the 2 maintainers of Turbo and Stimulus which leaves the projects pretty much dead for now, will this course still be released?
Michael S.
Michael S.
Read Full Comment
Hi! I see that Turbo feature was merged into the main symfony-ux branch recently. When can we expect the first chapters on this course? I'm not trying to put any pressure on you guys, I know that you have a lot of things…
Hey, I did run this is the console 'php bin/console importmap:require turbo-view-transitions'. I removed the old node_module folder and reinstall through 'npm install'. But still it gives the same error. I cannt find anything on how to install it with…
…The turbo-frame gets the HTML from the view. But the modal_controller doesnt trigger to open the dialog. I have 2 errors in the browser console: ``` Uncaught SyntaxError: The requested module 'http://127.0.0.1:8000/assets/vendor/@symfony/stimulus-bridge/stimulus-bridge…
…you have any idea why when i install symfony/ux-turbo, i have this exception : `An exception has been thrown during the rendering of a template ("Could not find an asset mapper path that points to the "turbo-core" controller in package "symfony/ux-turbo"…
Ludovic-J
Ludovic-J
Read Full Comment
…within a Turbo Frame. Form submission works , but when I want to dynamically show form fields, the new fields are not shown. I see the request being sent in the Web Inspector, but the dynamic fields do not show. When i set the data-turbo:…
Hi, I'm wondering about the template function `turbo_stream_listen` and authorization. I have not set the anonymous directive within the mercure config. The php publish method is using the configured jwt and the message is published. Whereas on the listening part I always…
Hey |mention:58721| It's hard to tell what's causing that unexpected behavior from Turbo, the only thing that catches my attention is the Response status code, try with 301, or 302 Cheers!
MolloKhan
MolloKhan
Read Full Comment
Do we still need to do the manipulation to make the forms compatible with turbo in symfony 6.4? I have the impression that it works correctly even without changing anything...
The deeper we go, the more confusig turbo-frames are...
Hello |mention:12406| Great catch. in fact with turbo you should first wait for it to appear on the page, and then wait for disappear, it can be achieved with some `spin()` functions like here described https://docs.behat.org/en/v2.5/cookbook/using…
I have issues with test execution speed :/ It looks like that `waitForTurboFrameLoad`check for any `turbo-frame[aria-busy="true"]` in the page is executed before Turbo adds the `aria-busy="true"` attribute to the frame. I had similar issue with the modal loading. The…
fbourigault
fbourigault
Read Full Comment
Hello.. When I add `data-turbo-frame="voyage-list"` to the element (~3:22 in the video), I don't see any change when searching. It still does a full-page reload and the cursor resets to the beginning of the field. I have triple…