Skip to content
\n

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:

\n
<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>
\n

When the form is submitted, the server returns:

\n
<tr id=\"row-103\"><!-- row content --></tr>
\n

But I'm getting this error:

\n
Uncaught (in promise) up.CannotMatch: Could not find common target in current page and response (tried selectors [#row-103, .content] in layer \"root\")\n
\n

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).

\n

Because 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.

\n

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.

\n

Could someone shed some light into it for me?

\n

Thank you!

","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

I just found #91 and I could resolve my issue with it.

\n

I 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?

","upvoteCount":1,"url":"https://github.com/unpoly/unpoly/discussions/777#discussioncomment-14446680"}}}
Discussion options

You must be logged in to vote

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?

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@triskweline
Comment options

@erickcomp
Comment options

Answer selected by erickcomp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants