amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Mutating bound src from a url to amp-state does not work

Open dmanek opened this issue 5 years ago • 1 comments

Description

In amp-render, I'm mutating the [src] from a url to amp-state, but there is no effect. The issue seems that the amp-state id is being interpreted as a URL and being appended to the base URL as such.

Reproduction Steps

  1. Check out PR https://github.com/ampproject/amphtml/pull/34512 and run amp
  2. Go to http://localhost:8000/examples/amp-render-bind.html
  3. Verify that all 3 amp-render instances load data from a URL
  4. Now click "Show Other Foods" button. This is changing the src to amp-state. No effect.
  5. Now click "Increment foo" button. Again no effect. It will update if you click "Show Fruit" or "Show vegetable"

While debugging, it seems to that isUrlAttribute function in url-rewrite.js is returning true when the value is an amp-state id.

Relevant Logs

No response

Browser(s) Affected

Chrome, Firefox, Safari

OS(s) Affected

All

Device(s) Affected

n/a

AMP Version Affected

latest

dmanek avatar May 25 '21 16:05 dmanek

Based on offline conversation with @caroqliu this is an unsupported use case that we haven't needed so far. Closing.

dmanek avatar May 25 '21 23:05 dmanek