# High DOM Size | Gravity Forms "Country" Field

**URL:** <https://community.gravityforms.com/t/high-dom-size-gravity-forms-country-field/15376>\
**Category:** Get Help\
**Tags:** dom, field-address\
**Created:** [June 19, 2023, 3:18pm UTC](https://community.gravityforms.com/t/high-dom-size-gravity-forms-country-field/15376 "2023-06-19T15:18:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![AeroStar](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/aerostar/32/15243_2.png) [@AeroStar](https://community.gravityforms.com/u/AeroStar)\
**Post date:** [June 19, 2023, 3:18pm UTC](https://community.gravityforms.com/t/high-dom-size-gravity-forms-country-field/15376/1 "2023-06-19T15:18:54Z")

</div>

Good Day,

When using the **Address** element of Gravity Forms, the **Country** field is impacting the DOM size of our affected GF pages. See below for details.

The above occurs on both desktop and mobile devices.

Fix (or comments) appreciated 🙂

Thank you,

Jonathan

* * *

[![Screenshot-1](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/b/b7291eb4ced818de6da9e66e43d05894f9342262.png)](https://ibb.co/FD5L3jx)  
[free image hosting](https://imgbb.com/)

---

<div class="post-metadata">

**Author:** ![AeroStar](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/aerostar/32/15243_2.png) [@AeroStar](https://community.gravityforms.com/u/AeroStar)\
**Post date:** [June 19, 2023, 6:38pm UTC](https://community.gravityforms.com/t/high-dom-size-gravity-forms-country-field/15376/2 "2023-06-19T18:38:40Z")

</div>

**Clarification:**

This is a general issue that impacts all Gravity Forms customers using the **Address** element.

Cheers 🙂

---

<div class="post-metadata">

**Author:** ![faisalahammad](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/faisalahammad/32/13948_2.png) [@faisalahammad](https://community.gravityforms.com/u/faisalahammad)\
**Post date:** [June 20, 2023, 8:48am UTC](https://community.gravityforms.com/t/high-dom-size-gravity-forms-country-field/15376/3 "2023-06-20T08:48:04Z")

</div>

You may follow this article:

> **[How to Reduce DOM Size in WordPress](https://wpspeedmatters.com/reduce-dom-size-in-wordpress/)**
>
> When analyzing your site through Google PageSpeed Insights you might have seen an error like “Avoid an excessive…

👉 **Quick Tips:**  
Set display none for a country list and add jQuery event listener so when you click on the dropdown, it’ll be a display block.

```auto
.countries-list {
  display: none;
}

```

Here is the jQuery code you may try:

```auto
$(document).ready(function() {
  $('#countryDropdown').on('click', function() {
    $('.countries-list').toggle();
  });
});

```

---

<div class="post-metadata">

**Author:** ![AeroStar](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/aerostar/32/15243_2.png) [@AeroStar](https://community.gravityforms.com/u/AeroStar)\
**Post date:** [June 20, 2023, 1:10pm UTC](https://community.gravityforms.com/t/high-dom-size-gravity-forms-country-field/15376/4 "2023-06-20T13:10:17Z")

</div>

Hey @faisalahammad,

Thank you so much for the information, insight, and proposed solution.

We’ll give that a spin and report back here our results. Stay tuned 🙂

Again, thank you.

Jonathan

---

<div class="post-metadata">

**Author:** ![AeroStar](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/aerostar/32/15243_2.png) [@AeroStar](https://community.gravityforms.com/u/AeroStar)\
**Post date:** [June 20, 2023, 6:23pm UTC](https://community.gravityforms.com/t/high-dom-size-gravity-forms-country-field/15376/5 "2023-06-20T18:23:16Z")

</div>

Hey @faisalahammad,

Unfortunately, your proposed solution did not work for us. Are you using it on one of your Gravity Forms pages?

Let’s see if we can mitigate the issue by lazy loading the dropdown contents. Stay tuned.

Again, thank you.

Jonathan

---

<div class="post-metadata">

**Author:** ![AeroStar](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/aerostar/32/15243_2.png) [@AeroStar](https://community.gravityforms.com/u/AeroStar)\
**Post date:** [June 21, 2023, 9:23pm UTC](https://community.gravityforms.com/t/high-dom-size-gravity-forms-country-field/15376/6 "2023-06-21T21:23:34Z")

</div>

**Update:**

We learned it’s not possible to lazy load the dropdown contents (i.e., country list) to mitigate this issue.

As it turns out, [the country list is rendered directly in the DOM output](https://prnt.sc/7RY-54BdVIsY) (not via a separate JS file).

So, we’re back to square one. Hoping that GF developers will review this topic and provide additional help.

Cheerio!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fef63f0599c45e0218c30d9f5d7ca8bff9b00189.png) [@system](https://community.gravityforms.com/u/system)\
**Post date:** [July 21, 2023, 9:24pm UTC](https://community.gravityforms.com/t/high-dom-size-gravity-forms-country-field/15376/7 "2023-07-21T21:24:30Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
