8000 Document the default row and string templates · Issue #19 · geocodeearth/autocomplete-element · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Document the default row and string templates #19
Open
@orangejulius

Description

@orangejulius

Today I was trying to write some new examples of customizing the autocomplete element, and wanted to provide examples that slightly modified either the string or (especially) row templates.

This turns out to be pretty hard, because the default templates are not written in plain HTML, as a custom template would be, but instead directly in a React component.

For the row template, I settled on the following HTML, which is probably close but not quite right:

  <template row>                                                                                                                                                                                            
    <li class="result-item">                                                                                                       
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"                                                                                                                         
    class="result-item-icon"><path fill-rule="evenodd" d="M5.05 4.05a7 7 0 119.9 9.9L10                                                                                                                     
    18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z"                                                                                                                                          
    clip-rule="evenodd"></path></svg>                                                                                                                                                                       
      ${item.feature.properties.label}                                                                                                                                                                      
    </li>                                                                                                                                                                                                   
  </template>        

If its not too difficult, we might want to provide a good starting point for customization in our docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0