inputpicker icon indicating copy to clipboard operation
inputpicker copied to clipboard

Suggestion

Open fammifarendra opened this issue 6 years ago • 3 comments

First issue, Selectmode is createable,

  1. select text on list,
  2. type anything not in the list
  3. Dont press tab, just click other button etc It will trigger blur event but the value still the value of number 1 above / previous value Because most people like to hit save button (not press tab) after they change their inputpicker value

Second issue, Please make update data list easy, right now i update data list by select $('#..').inputpicker({ .. }) again, it will create new inputpicker again (the id of that inputpicker is different), and sometimes it will mess up with tabindex

Third, if you can please make enter behave like tab, cause many people like to hit enter after they input data

thanks

fammifarendra avatar Sep 29 '19 11:09 fammifarendra

I solve my self For first issue i change blur event function _eventBlur(e) { var input = _i($(this)); var original = _o($(this)); if( _selectModeIsCreatable(input)) { if(!_inputValueEqualToOriginalValue(input)){ original.val(input.val()); } }

and i changed this too, so the first new text will get value

function _inputValueEqualToOriginalValue(input) { dd("_inputValueEqualToOriginalValue: _i(" + _i(input).val() + ") == _o(" + _o(input).val() + ")" ); var captain=true; captain=_i(input).data('value') == _o(input).val(); if(_o(input).val()==""){ captain=false} return captain; }

And for 3rd issue i change enter key event , so it behave like tab

case 13: // Enter e.preventDefault(); // Prevent from submitting form methods.toggle.call(input, e); if ( _setValueByActive(input) ){ _o(input).trigger('change'); } else{ _setValueForInput(input); _hideWrappedList(); } var idx = parseInt($(this).attr('tabindex')); idx++; var ada = $('[tabindex=' + idx + ']').length; if (ada != 1) { idx = 1 } if($('[tabindex=' + idx + ']').length>0){ $('[tabindex=' + idx + ']').focus(); $('[tabindex=' + idx + ']').select(); } break;

And for second issue, well it's no problem just for now so dont change anything for it

fammifarendra avatar Sep 29 '19 13:09 fammifarendra

Hi @fammifarendra , Thank you very much for your suggestion, can you please pull a request with your code so I can merge it straight away.

ukalpa avatar Oct 03 '19 19:10 ukalpa

Hi, ehm.. i dont know how to do pull request well, i modified again so inputpicker can search with wildcard, example we type red car, inputpicker will search for *red*car*

fammifarendra avatar Oct 12 '19 14:10 fammifarendra