-
|
Hi! Great v2 🎩 I'm integrating with Django framework, and trying to have a form in a modal that is successful to close the modal. When Django server has valid forms, it typically returns a 302 Redirect response: https://github.com/django/django/blob/main/django/views/generic/edit.py#L63-L65 However, I'm not finding a way to dismiss the layer in that case... well, no simple/classy way. Tried adding the X-Up-Dismiss-Layer header to the redirecting response that holds Location, but that didn't do the trick... Any idea please? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 27 replies
-
|
You could target the root layer from the Another option, if you know the final URL format, is to indicate it with an I'm presuming the 301 is to a URL that returns a 200 or 201. |
Beta Was this translation helpful? Give feedback.
-
|
The demo app also has a companies CRUD that shows @adam12's technique with |
Beta Was this translation helpful? Give feedback.
You could target the root layer from the
<form>element, with[up-layer="root"]. This attribute is only used for a successful response, IIRC.Another option, if you know the final URL format, is to indicate it with an
[up-accept-location]attribute on the<a>element that opens the new layer initially.I'm presuming the 301 is to a URL that returns a 200 or 201.