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

fix(ui5-multi-combobox): docs and API improvements #438

Merged
merged 1 commit into from
May 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/main/src/MultiComboBox.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
?disabled={{ctr.disabled}}
?readonly={{ctr.readonly}}
value-state="{{ctr.valueState}}"
show-suggestions
@ui5-input="{{ctr._inputLiveChange}}"
@ui5-change={{ctr._inputChange}}
@keydown="{{ctr._keydown}}">
Expand Down
14 changes: 14 additions & 0 deletions packages/main/src/MultiComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,18 @@ const metadata = {
* <li> Drop-down arrow - expands\collapses the option list.</li>
* <li> Option list - the list of available options.</li>
* </ul>
* <h3>Keyboard handling</h3>
*
* <h4>Tokens</h2>
* <ul>
* <li> Left/Right arrow keys - moves the focus selection form the currently focues token to the previous/next one (if available). </li>
* <li> Delete - deletes the token and focuses the previous token. </li>
* <li> Backspace - deletes the token and focus the next token. </li>
* </ul>
*
* <h4>Picker</h3>
* Alt + arrow down or F4 - opens the picker.
*
*
* @constructor
* @author SAP SE
Expand Down Expand Up @@ -327,10 +339,12 @@ class MultiComboBox extends UI5Element {

_handleKeyDown(event) {
if (isShow(event) && !this.readonly && !this.disabled) {
event.preventDefault();
this._togglePopover();
}

if (isDown(event) && this._getPopover()._isOpen && this.items.length) {
event.preventDefault();
const list = this.shadowRoot.querySelector(".ui5-multi-combobox-all-items-list");
list._itemNavigation.current = 0;
list.items[0].focus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

<head>
<title>&lt;ui5-multi-combobox&gt;</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no>

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">

Expand Down Expand Up @@ -31,7 +32,8 @@
</script>
<style>
.snippet ui5-multi-combobox {
width: 320px;
flex: 1;
min-width: 240px;
margin: 0 8px 8px 0;
}

Expand All @@ -53,7 +55,7 @@ <h2 class="control-header">MultiComboBox</h2>

<section>
<h3>Basic MultiComboBox</h3>
<div class="snippet">
<div class="snippet" style="display: flex; flex-wrap: wrap;">
<ui5-multi-combobox placeholder="Type your value">
<ui5-li selected>UI5</ui5-li>
</ui5-multi-combobox>
Expand Down Expand Up @@ -82,7 +84,7 @@ <h3>Basic MultiComboBox</h3>
<section>
<h3>MultiComboBox with items</h3>
<div class="snippet">
<ui5-multi-combobox style="width: 540px" placeholder="Choose your countries">
<ui5-multi-combobox style="width: 100%" placeholder="Choose your countries">
<ui5-li selected>Argentina</ui5-li>
<ui5-li>Bulgaria</ui5-li>
<ui5-li>Denmark</ui5-li>
Expand Down Expand Up @@ -114,7 +116,7 @@ <h3>MultiComboBox with items</h3>
<section>
<h3>MultiComboBox with items and build-in user input validation</h3>
<div class="snippet">
<ui5-multi-combobox style="width: 540px" validate-input placeholder="Choose your countries">
<ui5-multi-combobox style="width: 100%" validate-input placeholder="Choose your countries">
<ui5-li>Argentina</ui5-li>
<ui5-li selected>Bulgaria</ui5-li>
<ui5-li>Denmark</ui5-li>
Expand Down Expand Up @@ -146,7 +148,7 @@ <h3>MultiComboBox with items and build-in user input validation</h3>

<section>
<h3>MultiComboBox with Value State</h3>
<div class="snippet">
<div class="snippet" style="display: flex; flex-wrap: wrap;">
<ui5-multi-combobox value-state="Success">
<ui5-li>Fortune</ui5-li>
<ui5-li>Luck</ui5-li>
Expand Down