Title: Post Module Header &#8211; Term Filter
Last modified: February 5, 2021

---

# Post Module Header – Term Filter

 *  Resolved [krzd7](https://wordpress.org/support/users/krzd7/)
 * (@krzd7)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/post-module-header-term-filter/)
 * The term filter list works great, but it won’t close on mobile after selecting
   an option from the suspending list/menu.
 * Can you take a look?
 * Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Contributor [codersantosh](https://wordpress.org/support/users/codersantosh/)
 * (@codersantosh)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/post-module-header-term-filter/#post-14012324)
 * Hello [@krzd7](https://wordpress.org/support/users/krzd7/),
 * Thank you for the suggestion. We have the plan to add functionality if click 
   outside the flex menu, it will be closed. Similar to the [Advanced Post Module Demo](https://www.demo.gutentor.com/module-elements/advanced-post-module/).
   We may not add the exact feature suggested by you, but you can try following 
   code.
 *     ```
        $(document).on('click', '.flexMenu-popup a', function() {
                           $('li.flexMenu-viewMore > a').trigger('click');
                       })
       ```
   
 * Best Regards!
 *  Thread Starter [krzd7](https://wordpress.org/support/users/krzd7/)
 * (@krzd7)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/post-module-header-term-filter/#post-14013263)
 * Close by clicking outside the menu would be great.
 * Your code/suggestion works just fine, thanks a lot.
 *  Plugin Contributor [codersantosh](https://wordpress.org/support/users/codersantosh/)
 * (@codersantosh)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/post-module-header-term-filter/#post-14017603)
 * Most welcome!
    Marking as resolved 🙂
 *  Thread Starter [krzd7](https://wordpress.org/support/users/krzd7/)
 * (@krzd7)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/post-module-header-term-filter/#post-14022188)
 * I ended up implementing your idea of closing when clicking outside the flex menu,
   in case you want to add for the next update.
 * In fact, you’ll see that I’ve combined both ideas but commented the conditional
   that would close when clicking the link itself.
 *     ```
       $(document).on('click', function(e) {
         var flexMenuPopup = $('ul.flexMenu-popup');
   
         if (!flexMenuPopup || !flexMenuPopup.is(":visible")) return;
   
         var target = $(e.target);
   
         if (!target /*|| target.parents('li.gutentor-filter-item').length*/ || !target.parents('ul.gutentor-filter-list').length) {
               flexMenuPopup.hide();
         }
       });
       ```
   
 *  Plugin Contributor [codersantosh](https://wordpress.org/support/users/codersantosh/)
 * (@codersantosh)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/post-module-header-term-filter/#post-14023016)
 * [@krzd7](https://wordpress.org/support/users/krzd7/) thanks for the code, we 
   added this code, I think result is the same
 *     ```
       gDocument.click(function(e){
           if( $(e.target).closest('li.flexMenu-viewMore ').length > 0 ) {
               return false;
           }
           $('li.flexMenu-viewMore > a').trigger('click');
       });
       ```
   
 *  Thread Starter [krzd7](https://wordpress.org/support/users/krzd7/)
 * (@krzd7)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/post-module-header-term-filter/#post-14024423)
 * Hi,
 * I have tested this and, except for the sanity checks, it behaves the same. It
   triggers the click even if the flex menu is not open at all, but it does not 
   seem to matter that much.
 * Thanks for adding this, I’ll remove my custom js once you guys update 🙂
 *  Plugin Contributor [codersantosh](https://wordpress.org/support/users/codersantosh/)
 * (@codersantosh)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/post-module-header-term-filter/#post-14036173)
 * Hello [@krzd7](https://wordpress.org/support/users/krzd7/) ,
 * Please update the Gutentor plugin to the latest version, now flex menu should
   close when click outside of it.
 * Best Regards!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Post Module Header – Term Filter’ is closed to new replies.

 * ![](https://ps.w.org/gutentor/assets/icon.svg?rev=2144459)
 * [Gutentor - Gutenberg Blocks - Page Builder for Gutenberg Editor](https://wordpress.org/plugins/gutentor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gutentor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gutentor/)
 * [Active Topics](https://wordpress.org/support/plugin/gutentor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gutentor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gutentor/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [codersantosh](https://wordpress.org/support/users/codersantosh/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/post-module-header-term-filter/#post-14036173)
 * Status: resolved