Skip to content
Discussion options

You must be logged in to vote

Hello @hasnatbabur ,

To allow users to select a value even when the search results are empty, you can implement a custom JavaScript solution. Here’s an example that demonstrates how to achieve this:

<!doctype html>
<html lang=“en”>
  <head>
    <title>ComboBox</title>
  </head>
  <body>
    <div
      class=“relative max-w-sm”
      data-combo-box=‘{
        “apiUrl”: “https://restcountries.com/v3.1”,
        “apiSearchPath”: “name”,
        “apiSearchDefaultPath”: “all”,
        “outputEmptyTemplate”: “<div class=\“dropdown-item\“>No results found. Press Enter to use entered value.</div>“,
        “outputItemTemplate”: “<div class=\“dropdown-item combo-box-selected:dropdown-active\” data…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hasnatbabur
Comment options

Answer selected by hasnatbabur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants