Skip to content
This repository was archived by the owner on Aug 30, 2018. It is now read-only.
This repository was archived by the owner on Aug 30, 2018. It is now read-only.

Customer Addresses Page - Javascript errors #385

@schaeken

Description

@schaeken

A Javascript error occurs on the customer address page. The first issue happens when you have enough addresses that you start pagination on the page.

"Uncaught TypeError: Cannot read property 'addEventListener' of null"

http://snapify.shopify.com/31-17-rbkk5-x2rhz.jpg

This issue happens when you try to delete an address on a page that is paginated

"Uncaught TypeError: Cannot read property 'destroy' of undefined"

http://snapify.shopify.com/31-23-wq17f-b00yh.jpg

This had cause an issue when a theme developer used this theme as their base structure and was using javascript to scroll things.

They suggested this:

{% for address in customer.addresses %} 
new Shopify.CountryProvinceSelector('AddressCountry_{{ address.id }}', 'AddressProvince_{{ address.id }}', { 
hideElement: 'AddressProvinceContainer_{{ address.id }}'} 
); 
{% endfor %} 

Should be replaced with:

{% paginate customer.addresses by 5 %} {% for address in customer.addresses %} 
new Shopify.CountryProvinceSelector('AddressCountry_{{ address.id }}', 'AddressProvince_{{ address.id }}', { 
hideElement: 'AddressProvinceContainer_{{ address.id }}'} 
); 
{% endfor %}{% endpaginate %}

@cshold

@Shopify/design-gurus

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