Skip to content

feat(ui5-input-table-suggest): introduce new InputTableSuggest component - #13678

Open
ndeshev wants to merge 83 commits into
mainfrom
input-tabular-suggestions-alt
Open

ndeshev wants to merge 83 commits into
mainfrom
input-tabular-suggestions-alt

Conversation

@ndeshev

@ndeshev ndeshev commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

JIRA: BGSOFUIRILA-4203

Related to #13666

Overview

This branch introduces a significant refactoring of the ui5-input component architecture by extracting a base class (InputField) and creating a new InputTableSuggest component for tabular suggestions.

Architecture Changes

Before:
ui5-input (All functionality mixed)

After:
InputField (Core input functionality) ← New private base class
├── ui5-input (List-based suggestions)
└── ui5-input-table-suggest (Table suggestions)

New Files

  • InputField.ts - Private base class with core input functionality
  • InputFieldTemplate.tsx - Base template with hook system for extensibility
  • InputField.css - Base styles extracted from Input.css
  • InputTableSuggest.ts - New component for tabular suggestions
  • InputTableSuggestTemplate.tsx - Template for tabular suggestions popover
  • InputTableSuggestPopoverTemplate.tsx - Popover template with Table component

InputField (Base Class)

Contains all non-suggestion-related functionality:

  • Properties: value, placeholder, disabled, readonly, required, type, valueState, maxlength, showClearIcon, accessibility properties
  • Slots: icon, valueStateMessage
  • Events: change, input, select
  • Features: Form integration, value state handling, IME composition, clear icon, accessibility, resize handling

ui5-input (Extends InputField)

Adds list-based suggestions:

  • Properties: showSuggestions, highlight, noTypeahead, filter
  • Slots: suggestionItems (SuggestionItem/SuggestionItemGroup)
  • Events: selection-change, type-ahead, suggestion-scroll, open, close
  • Uses InputSuggestions feature for suggestion handling

ui5-input-table-suggest (Extends InputField) - NEW

Adds tabular suggestions (like SAPUI5's sap.m.Input with tabular suggestions):

  • Properties: showSuggestions, noTypeahead, open
  • Slots: suggestionColumns (TableHeaderCell), suggestionRows (TableRow)
  • Events: selection-change, type-ahead, open, close
  • Displays suggestions in a Table with multiple columns
  • Supports typeahead from first column only
  • Uses automatic popin mode for responsive behavior

Key Design Decisions

  1. InputField is private - not intended for direct use, only through subclasses
  2. Clean separation - suggestion logic completely removed from base class
  3. Shared value state handling - both subclasses inherit value state popover
  4. Independent suggestion implementations - ui5-input uses List, InputTableSuggest uses Table
  5. Styles inheritance - subclasses extend InputField.styles array

Migration Impact

  • No breaking changes for ui5-input consumers
  • New ui5-input-table-suggest component available for tabular suggestion use cases
  • Internal refactoring only; public API preserved

Additional notes:

The internal ui5-table now renders the app's real slotted elements via native chained projection
instead of cloning them:
→ forwards the app's ui5-table-header-row into Table's headerRow slot.
→ forwards rows into Table's default rows slot.
Because elements stay in the app's light DOM, live cell mutations now reflect without a re-render — the
main bug the old remap couldn't handle.
API shift

Columns are now declared as one ui5-table-header-row (single-element slot) wrapping
ui5-table-header-cells, instead of loose header cells. JSDoc updated on both slots.
Removed

All built-in highlighting logic; apps now do app-side highlighting (demonstrated in the new RichCells
sample).
Table-side fixes for projection

TableCell._headerCell now resolves the owning table via row._table instead of parentElement (which is
InputTableSuggest under projection) — fixes popin labels / alignment.
TableRowBase._table result is cached (_tableRef), cleared on connect/disconnect.
New Table._rows / Table._headerRow getters

Table.ts gained _rows and _headerRow getters that call getSlottedNodes() to flatten chained
projection, returning the real ui5-table-row / ui5-table-header-row even when the table is nested inside
another component.
The entire Table subsystem was migrated from this.rows / this.headerRow to these internal getters:
TableNavigation, TableSelection, TableSelectionBase, TableSelectionMulti, TableSelectionSingle,
TableGrowing, TableVirtualizer, TableDragAndDrop, TableGroupRow, TableRow, TableCustomAnnouncement,
TableTemplate, and TableRowBase._hasPopin. Without this, every table feature would see the raw
placeholder instead of the projected rows — this is what actually makes projection work end to end.

ndeshev added 2 commits June 10, 2026 08:46
This POC uses ui5-table rendering instead of a native one

JIRA: BGSOFUIRILA-4203

related to #13666
@ndeshev
ndeshev temporarily deployed to netlify-preview June 11, 2026 08:10 — with GitHub Actions Inactive
@sap-ui5-webcomponents-release

Copy link
Copy Markdown

major refactoring and improvements, added tests
@ndeshev
ndeshev temporarily deployed to netlify-preview July 8, 2026 14:12 — with GitHub Actions Inactive
minor fixes, value state functionality implementation
@ndeshev
ndeshev temporarily deployed to netlify-preview July 10, 2026 14:22 — with GitHub Actions Inactive
@ndeshev
ndeshev temporarily deployed to netlify-preview July 13, 2026 07:19 — with GitHub Actions Inactive
@ndeshev ndeshev changed the title feat(ui5-tabular-input): introduce new tabular suggestions input (wip) feat(ui5-tabular-input): introduce new tabular suggestions input Jul 13, 2026
@ndeshev
ndeshev marked this pull request as ready for review July 13, 2026 07:20
@ndeshev
ndeshev temporarily deployed to netlify-preview July 14, 2026 05:37 — with GitHub Actions Inactive
@ndeshev
ndeshev temporarily deployed to netlify-preview July 14, 2026 06:15 — with GitHub Actions Inactive
@ndeshev
ndeshev temporarily deployed to netlify-preview July 14, 2026 11:56 — with GitHub Actions Inactive
@ndeshev
ndeshev temporarily deployed to netlify-preview July 15, 2026 12:42 — with GitHub Actions Inactive
@nikoletavnv
nikoletavnv self-requested a review July 16, 2026 09:19
@nikoletavnv

Copy link
Copy Markdown
Contributor

The input border disappears once the focus goes to table row but the mouse hovers the input field

image

@nikoletavnv

Copy link
Copy Markdown
Contributor

Announcing the selected row differs from OpenUI5 table suggestions. In the other application when going through the items, first the number of the row is announced with some other information. After the value column is announced, the rest of the columns and their values for the selected row are also announced.
At the moment in this PR - only the selected value is announced without extra columns information

Comment thread packages/main/src/TabularInput.ts Resolved
Comment thread packages/main/src/TabularInput.ts Resolved
Comment thread packages/main/src/TabularInput.ts Resolved
Comment thread packages/main/src/TabularInput.ts Resolved
@nikoletavnv

Copy link
Copy Markdown
Contributor

Highlighting of the input text is trimming spaces. The original text in the second column is "Widget Alpha" but when bolded it is "WidgetAlpha":

image

Comment thread packages/main/src/TabularInput.ts Resolved
@MapTo0

MapTo0 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

overall API looks good

@MapTo0 MapTo0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the work on this — the component shape and the split into row/cell subcomponents read well. I ran a review pass and have 10 findings below, ordered roughly most-severe first. The three I'd like resolved before merge are:

  1. _onfocusout does not call super._onfocusout — base-class blur bookkeeping is silently skipped.
  2. :host([_isPhone]) CSS selector never matches — _isPhone is a getter, not a reflected @property, so the mobile max-height override is dead.
  3. Enter with no matching row falls through to super._onkeydown without preventDefault, so the form may submit via _request-submit while the popover was open.

The rest are correctness/style nits worth folding in while the component is still @experimental. Happy to discuss any of them.

Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/themes/InputField.css Resolved
Comment thread packages/main/src/themes/Select.css Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved

@niyap niyap left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please check the aria-describedby attribute in ui5-input as well as the specification. Also check availableSuggestionsCount() in ui5-input - when the dropdown is open there is an announcement that it is expanded as well as the count of the suggestions available where that is not the case with tabular suggestions.

Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment thread packages/main/src/InputTableSuggest.ts Resolved
* @param {HTMLElement | null} row The highlighted or selected suggestion row.
* @public
*/
@event("selection-change", { bubbles: true })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

another case that is not working. If you type something and press enter to confirm the autocompleted value, popover is closed, change is fired, then if you delete a character, popover is open again without selection presented, but selection-change is not fired. Even if you press then Enter, it is not fired

@ndeshev ndeshev Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a controversial one, I will leave it as it is for now. In that case the selection is finalized and confirmed, change is fired, then when the popover is open there is no selection and it never was. I know that you mean the clearing of the previously selected item's value maybe should fire the event but I am not sure for that case, when popover is closed and value confirmed. No visible selection is changed in the suggestions on the second open and also the app in will still be able to have full control because of the 'change' event.

Comment thread packages/main/src/InputTableSuggest.ts Resolved
Comment on lines +31 to +56
class InputTableSuggestCell extends TableCell {
/**
* Defines the content of the cell.
*
* @public
*/
@slot({ type: Node, "default": true })
declare content: DefaultSlot<Node>;

/**
* Determines the horizontal alignment of the cell content.
*
* @default undefined
* @public
*/
@property()
declare horizontalAlign?: `${TableCellHorizontalAlign}`;

/** @private */
@property({ type: Boolean })
declare merged: boolean;

onEnterDOM() {
super.onEnterDOM();
this.toggleAttribute("ui5-table-cell", true);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

those properties already available in the TableCell and you expose the base with @extends so why all that necessary? at least the implementation like onEnterDom could be left to the base class.

The same question applies for all other Table subclasses in this change

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hello @aborjinik, thanks for the feedback.

I dropped the content and horizontalAlign re-declarations, removed now-unused slot, DefaultSlot, TableCellHorizontalAlign imports.

I kept the onEnterDOM overrides because UI5Element auto-adds only a tag-named attribute, so differently-tagged subclass must manually re-add (ui5-table-cell etc.)

Comment thread packages/main/src/Input.ts Resolved

@niyap niyap left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  1. If you type "PR" in the first sample of InputTableSuggest, then delete the autocompleted value (selection over first item is cleared), on Tab the first matching item is autocompleted. That does not happen both with ui5-input and sap.m.Input with tabular suggestions
  2. When we have value state and suggestion and enough space to show the value state popover below the input but not enough to show the suggestions popover, when open the suggestion together with the value state header are shown above the input but the value state message popover remains open below the input just empty
Screenshot 2026-11-16 at 12 18 10

Comment thread packages/main/src/Input.ts Resolved
Comment thread packages/main/src/Input.ts Resolved
Comment thread packages/main/src/Input.ts Resolved
Comment thread packages/main/src/InputField.ts Resolved
Comment thread packages/main/src/Input.ts Resolved
*
* @constructor
* @extends TableHeaderRow
* @since 2.28.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please be aware before merging to check the currently developed version and change the @ since tag everywhere.

@ndeshev

ndeshev commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author
  1. If you type "PR" in the first sample of InputTableSuggest, then delete the autocompleted value (selection over first item is cleared), on Tab the first matching item is autocompleted. That does not happen both with ui5-input and sap.m.Input with tabular suggestions
  2. When we have value state and suggestion and enough space to show the value state popover below the input but not enough to show the suggestions popover, when open the suggestion together with the value state header are shown above the input but the value state message popover remains open below the input just empty
Screenshot 2026-11-16 at 12 18 10

Fixed it.

This branch was previously deployed

1 inactive deployment
netlify-preview — d6bce00e Deployed Dec 1, 2026 by ndeshev via deploy-preview #3895
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.

6 participants