Each how has an \"edit associations\" link, which opens up a form into a modal and loads some content.
\nThis form is rendered like this:
<form\n action=\"http://localhost/edit associations/103\"\n method=\"post\"\n up-submit=\"up-submit\"\n up-layer=\"root\"\n up-target=\"#row-103\"\n up-match=\"first\"\n up-fallback=\".content\"\n class=\"up-can-clean\">\n<!-- form content -->\n</form>When the form is submitted, the server returns:
\n<tr id=\"row-103\"><!-- row content --></tr>But I'm getting this error:
\nUncaught (in promise) up.CannotMatch: Could not find common target in current page and response (tried selectors [#row-103, .content] in layer \"root\")\nI put the .content into the up-fallback to inspect the HTML from root. If I don't use it, it does not throw the error, but replaces the body with the tr content (without the tr tag itself).
\nBecause I could not overcome this, I created a very simple project to debug the issue.
\nIn this simple project (with super simple HTML) it works as intended. In this simpler project I did not use up-match. It just worked.
I also tried to put some breakpoints into unpoly's code to understand why it's not being able to match and swap the tr elements, but I was unable to come to a conclusion, because when I use up-match first, I can debug to a point where it matches it in response and in document, but it keeps trying to match and I could not get the point when it does not match anymore.
\nCould someone shed some light into it for me?
\nThank you!
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"I just found #91 and I could resolve my issue with it.
\nI think that updating table rows might be a pretty common case. How about including this common case in the docs?
\nAre you open to receive a PR regarding this?
-
|
Hello, first of all: Thanks for this awesome project. I think my situation might be linked to #648 , but I'm not sure, as the pieces of code that was provided into that thread is not accessible anymore. My situation: I got an HTML table, like this <table>
<!-- headers and all -->
<tr id="row-103"><!-- row content --></tr>
<!-- other rows -->
</table>Each how has an "edit associations" link, which opens up a form into a modal and loads some content. <form
action="http://localhost/edit associations/103"
method="post"
up-submit="up-submit"
up-layer="root"
up-target="#row-103"
up-match="first"
up-fallback=".content"
class="up-can-clean">
<!-- form content -->
</form>When the form is submitted, the server returns: <tr id="row-103"><!-- row content --></tr>But I'm getting this error: I put the .content into the up-fallback to inspect the HTML from root. If I don't use it, it does not throw the error, but replaces the body with the tr content (without the tr tag itself). Because I could not overcome this, I created a very simple project to debug the issue. I also tried to put some breakpoints into unpoly's code to understand why it's not being able to match and swap the tr elements, but I was unable to come to a conclusion, because when I use up-match first, I can debug to a point where it matches it in response and in document, but it keeps trying to match and I could not get the point when it does not match anymore. Could someone shed some light into it for me? Thank you! |
Beta Was this translation helpful? Give feedback.
-
|
I just found #91 and I could resolve my issue with it. I think that updating table rows might be a pretty common case. How about including this common case in the docs? |
Beta Was this translation helpful? Give feedback.
I just found #91 and I could resolve my issue with it.
I think that updating table rows might be a pretty common case. How about including this common case in the docs?
Are you open to receive a PR regarding this?