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

feat(ui5-multi-input): initial implementation #1942

Merged
merged 16 commits into from
Aug 13, 2020
Merged

feat(ui5-multi-input): initial implementation #1942

merged 16 commits into from
Aug 13, 2020

Conversation

MapTo0
Copy link
Member

@MapTo0 MapTo0 commented Jul 10, 2020

No description provided.

- add test for multi input
- correct input tests
Copy link
Contributor

@vladitasev vladitasev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I think it should use its own item, not directly tokens. Now it differs from select, combobox, multicombobox, input with suggestions in that regard (they all have their own items, and multiinput uses a generic token item)
  • Looks like a low-level component that is intended for component authors, rather than for applications. If we ship it like this, apps would have to create a popover or other interface with the options when they click the button, they would have to manage deleting tokens, everything... I'd suggest we rename this to multiinputbase for example for users that want flexibility (f..e to create their own logic of deleting tokens, custom popover) and have a default implementation called multiinput that is fully functional. Or is it too similar to multicombobox if we did this?

In any case, even if we leave it at that, there should be at least one fully working example how people can take advantage of this component. I'm afraid there might be issues if they try implementing KBH and focus if we leave the details to them and only provide them the barebone tokenizer wrapper.

packages/main/src/Input.hbs Outdated Show resolved Hide resolved
const popover = await this._getPopover();

if (popover) {
popover.close(false, false, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have almost the same function on the progotype, only the .close() parameters are different.
Please use that other function and modify it to pass all arguments to the .close() method

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

focusout should be sync to get a proper handling of it. I did this method to prevent making it async

packages/main/src/Input.js Show resolved Hide resolved
* Indicates whether the tokenizer is expanded or collapsed(shows the n more label)
* @private
*/
expandedTokenizer: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not use the word "tokenizer" at all, this is a technical implementation, the users don't know what this means.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a private property, any proposal for another name?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In UI5 we have introduced the enumeration renderMode with values "Narrow" and "Loose", which we believe describe the "rendering behaviour" well. Also it allows for expansion in future with other modes.

* @public
*/
tokens: {
type: Token,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we always put HTMLElement here and don't check for types any more in slots

*/
tokens: {
type: Token,
multiple: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all slots are multiple, this is only for properties now, so I would suggest creating a default slot:

default: {
  type: HTMLElement,
  propertyName: "tokens"
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Items is a default slot for input and its ancestors - MultiInput

packages/main/src/MultiInput.js Outdated Show resolved Hide resolved
Copy link
Member

@ilhan007 ilhan007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left few comments below, but I also would like to test the MultiInput and the Input in exploratory fashion.

packages/main/src/Input.js Outdated Show resolved Hide resolved
packages/main/src/InputPopover.hbs Outdated Show resolved Hide resolved
packages/main/src/MultiInput.js Show resolved Hide resolved
packages/main/src/MultiInput.js Outdated Show resolved Hide resolved
packages/main/src/Token.js Show resolved Hide resolved
packages/main/src/Token.js Outdated Show resolved Hide resolved
packages/main/test/pages/MultiComboBox.html Outdated Show resolved Hide resolved
Copy link
Member

@ilhan007 ilhan007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Find an Input with suggestions ("Input in Cozy" example within the Input test page):

  • click in the input field
  • type a letter to open the suggestions
  • press Arrow Down

Instead of navigating within the list, the popover closes.

Use this example "Input suggestions with ui5-li"

  • click in the input field
  • type a letter to open the suggestions
  • press Arrow Up

Instead of navigating within the list, the popover closes.

Use this example "Input suggestions with ui5-li", the same as above

  • click in the input field
  • type a letter to open the suggestions
  • start pressing Arrow Down

After few successful navigations, the popover closes.

Copy link
Member

@ilhan007 ilhan007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The input field and more button are missing in the phone view

image from openui5
Screenshot 2020-08-12 at 11 54 13 AM

Copy link
Member

@ilhan007 ilhan007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(1) Is there a public event the users can listen to in order to react on those close buttons in the popover. I could see "value-help-icon-press" in the metadata only. in the code there is "token-delete" being fired and should be documented, because it is not inherited from the Input class.

(2) When you press a close button, as it takes the focus, you can see the "more" text is displayed, but this is not a huge issue
Screenshot 2020-08-12 at 11 56 44 AM

packages/main/src/Token.js Outdated Show resolved Hide resolved
ilhan007
ilhan007 previously approved these changes Aug 12, 2020
Copy link
Contributor

@vladitasev vladitasev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR seems to revert a change I did some time ago:

#2039

probably due to a bad merge.

@MapTo0 MapTo0 merged commit 5d7e7df into master Aug 13, 2020
@MapTo0 MapTo0 deleted the multiinput branch August 13, 2020 12:27
@MapTo0
Copy link
Member Author

MapTo0 commented Aug 13, 2020

FIXES: #1852

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants