question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request][Dropdown] Clean Selection ...

See original GitHub issue

Feature Request

Description

how i can implements this feature by set a setting ?

Example

<div class="ui search selection dropdown">
  <i class="dropdown icon"></i>
  <input name="language" type="hidden" class="" value="fa_IR">
  <input class="search" autocomplete="off" tabindex="0">
  <div class="default text"></div>
  <div class="menu " tabindex="-1">
    <div class="item" data-value="fa_IR">فارسی (ایران)</div>
  </div>
</div>
$('.ui.dropdown').dropdown({
  forceSelection : false,
  fullTextSearch : true,
  onHide : function(){ //feature is here
    $(this).dropdown('set selected',$(this).dropdown('get value')).find('>input.search').val('');
  },
});

Testcase

http://jsfiddle.net/jr6tnge1/

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lubber-decommented, Sep 5, 2019

@ziaratban After thinking about it for a while now, i think we can make use of the already existing allowAdditions setting. This is false by default and should remove the searchterm when it does not match anything. I prepared a PR to support that here https://github.com/fomantic/Fomantic-UI/pull/1002

1reaction
lubber-decommented, Sep 4, 2019

I am still not understanding your use case.'forceSelection:true of course selects anything matching while typing, that’s the intention of it. The code you are providing always removes the search term when hiding the menu. That is not the intention of forceSelection:false . It’s meant to be able to select something which is not in the list. I am not sure if we really should add an option to always remove the searchterm on hide if nothing is found… Let’s see what others say

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dropdown reset/clear selection(TWX 9.1) - PTC Community
I have 2 dropdowns, I want to reset/clear selection for first dropdown when the selected row is changed in second dropdown. How to...
Read more >
[Feature Request] Clear select component programmatically
Description. If I'm not mistaken, there is no way to clear, or reset el-select component to its placeholder from within parent component.
Read more >
Clear the dropdown list - Feature Requests - Redash Discourse
Example: I have the dropdown list with 20 values, by default - all values are selected, but I want choice only one values....
Read more >
How do I clear all options in a dropdown box? - Stack Overflow
To remove the options of an HTML element of select , you can utilize the remove() method: function removeOptions(selectElement) { var i, ...
Read more >
Reset Dropdown selection | Velo by Wix
How can i reset the dropdown selections? can i clear the dropdowns items? ... You can vote, comment, and track the status of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found