Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pb-select in pb-repeat templates #29

Open
tuurma opened this issue Aug 31, 2020 · 1 comment
Open

pb-select in pb-repeat templates #29

tuurma opened this issue Aug 31, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@tuurma
Copy link
Member

tuurma commented Aug 31, 2020

Extending pb-search with pb-repeat/pb-select leads to incorrect query parameter set when serializing the default first instance of the pb-repeat

Setting <pb-repeat initial=0> works well, thus the problem lies probably in initializing pb-repeat/template

image

image

<pb-search id="search-form" subscribe="search"
                                    data-template="pages:parse-params" value="${query}" submit-on-load="submit-on-load">
      <pb-repeat> 
            <template>
                  <pb-select name="bar" label="bar" source="modules/autocomplete.xql?query=k"/>
            </template>
     </pb-repeat>                                    
</pb-search>
@tuurma tuurma added the bug Something isn't working label Sep 15, 2020
@daliboris
Copy link
Contributor

I found the solution for this issue:

const name = (input.name === undefined) ? ${input.attributes.getNamedItem("name").nodeValue}[${idx}] : ${input.name}[${idx}];

Name of the element can be reached as the attribute value if the name property is undefined.

I'll prepare pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants