Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SEARCH] - inputClear after selection #6455

Closed
wants to merge 2 commits into from
Closed

[SEARCH] - inputClear after selection #6455

wants to merge 2 commits into from

Conversation

MrMarci666
Copy link

@MrMarci666 MrMarci666 commented Jun 27, 2018

Hi All!

I made a solution for a bug.

You can find out the bug here:
THE ISSUE HERE WITH EXAMPLE

I added a new field for settings!
now it is: inputClear
It can be true or false.
if false: put the selected value to input.
if true: clear the input.
It doesn't give the focus back after click, that is annoying too, but easily you can do it with adding this to the initialization of the .ui.search element:

onSelect: function(result, response) { 
     $(this).find('input').focus(); 
}

Now, the solution is here:
adding this to the settings:
HERE

  // after selection clearing the input field
  inputClear	 : false,

AND

adding this HERE:

 if (settings.inputClear == true) module.set.value('');
else  module.set.value(value);

It's quite simple. And now you can initialize your .ui.search element like this:
$(.ui.search).search({ inputClear: true })
And it will cleared always after a selection made.

or set that false, or just don't do anything, and the module will fill out the input field with the selected value! 👍

Sorry, I am very new here, I don't know how to edit the modules correctly, if you help me out, that would be great! 💃

sciyoshi and others added 2 commits June 21, 2018 11:25
Any custom theme.config files will need to be updated to add the (multiple)
option when including theme.less.
[Dependency] Add compatibility with Less 3.x
@y0hami
Copy link
Member

y0hami commented Jun 27, 2018

The files changed aren't to do with the issue mentioned.

@MrMarci666
Copy link
Author

Yes, how to edit them, that is a mystery for me now. I edited the comment, see the solution is there.

@MrMarci666 MrMarci666 closed this Jun 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants