Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. Bug Reports
  3. Clicking on search suggestions not working

Clicking on search suggestions not working

Scheduled Pinned Locked Moved Bug Reports
5 Posts 2 Posters 118 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CasperK
    wrote on last edited by
    #1

    In the Lay Theme, after typing a few letters in the search input, a list with suggestions is shown. It is however almost impossible to select the text from the suggestions by clicking, because the list is hidden before the click event is handled.

    A solution to make it work is to register the blur even not on the input, but on it's parent. So instead of:
    events: {
    "input #search-query": "onInput",
    "focus #search-query": "onFocus",
    "blur #search-query": "onBlur",
    "click .close-search": "onHide"
    },
    The blur event can be set on the .search-inputs selector:
    events: {
    "input #search-query": "onInput",
    "focus #search-query": "onFocus",
    "blur .search-inputs": "onBlur",
    "click .close-search": "onHide"
    },

    This way the blur event only occurs when the focus of all the search components is lost. Clicking on the suggestions will not trigger the blur, which in my opinion should not be done as the suggestions are part of the search input.

    1 Reply Last reply
    0
    • arminunruhA Offline
      arminunruhA Offline
      arminunruh
      Global Moderator
      wrote on last edited by
      #2

      hey there so you'd like to be able to copy the suggestion?
      why would you want to copy it?

      you can just click on them to make the search overlay search for that text

      1 Reply Last reply
      0
      • C Offline
        C Offline
        CasperK
        wrote on last edited by
        #3

        Hello, thank you for your reply.

        I want to fill the text from the suggestion in the search input. This often doesn't work.

        The problem is when I try to click a suggestion the blur event from the search input hides the suggestions before the click event is handled. So only when the click event is triggered within 100ms it works. I see that blur only works on inputs, not on div elements, so maybe the delay for hiding must be longer.

        1 Reply Last reply
        0
        • arminunruhA Offline
          arminunruhA Offline
          arminunruh
          Global Moderator
          wrote on last edited by
          #4

          oh really

          what is your website address

          1 Reply Last reply
          0
          • C Offline
            C Offline
            CasperK
            wrote on last edited by
            #5

            I fixed the issue on the main website, but on the test site I reverted the modification. You can check the problem here: https://new.pakhaus.nl/

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            I also code custom websites or custom Lay features.
            šŸ’æ Email me here: šŸ’æ
            info@laytheme.com

            Before you post:
            1. When using a WordPress Cache plugin, disable it or clear your cache.
            2. Update Lay Theme and all Lay Theme Addons
            3. Disable all Plugins
            4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

            This often solves issues you might run into

            When you post:
            1. Post a link to where the problem is
            2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
            3. If the problem is difficult to explain, post screenshots / link to a video to explain it
            Online Users
            dranuradhasinghD
            dranuradhasingh
            N
            NAS
            M
            mimimin
            thewhitesmilesT
            thewhitesmiles
            Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
            laytheme.com
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Recent
            • Tags
            • Popular
            • Users
            • Search