Skip to content

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

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

feat(ui5-input-table-suggest): introduce new InputTableSuggest component#13678
ndeshev wants to merge 34 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

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/TabularInputPopoverTemplate.tsx Outdated
Comment thread packages/main/src/TabularInputPopoverTemplate.tsx Outdated
Comment thread packages/main/src/TabularInputPopoverTemplate.tsx Outdated
Comment thread packages/main/src/TabularInputPopoverTemplate.tsx Outdated
Comment thread packages/main/src/InputTableSuggestPopoverTemplate.tsx
Comment thread packages/main/src/TabularInput.ts Outdated
Comment thread packages/main/src/TabularInput.ts Outdated
Comment thread packages/main/src/TabularInput.ts Outdated
Comment thread packages/main/src/TabularInput.ts Outdated
{processedRow.cells.map((cell, cellIndex) => (
<TableCell
key={`cell-${rowIndex}-${cellIndex}`}
dangerouslySetInnerHTML={{ __html: cell.highlightedMarkup }}

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.

I can set a script for the table cell like this: <ui5-table-cell><script>alert("aaaaaaaa");</script></ui5-table-cell> and the script will be executed on page load. Also I am not able to select this row from the suggestions by pressing "Enter" - nothing happens.

@ndeshev ndeshev Jul 20, 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 NOT a vulnerability in the component by itself. The script executes because it's part of the original declarative HTML in the document. When the browser parses <ui5-table-cell><script>alert("XSS");</script></ui5-table-cell> the <script> tag is executed immediately by the browser's HTML parser - this happens before any JavaScript framework code runs. This is standard browser behavior.

If an application allows users to input arbitrary HTML into suggestion rows (e.g., from a database or API), it should sanitize that data before inserting it into the DOM, not rely on the highlighting mechanism or front-end sanitization of any kind. The script executes at HTML parse time, before any sanitization in JavaScript can run.

@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 Outdated
Comment thread packages/main/test/pages/InputTableSuggest.html
id="scrollSearch"
placeholder="Search with scroll..."
show-suggestions
overflow-mode="Scroll"

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.

When overflow-mode="Scroll" on mobile devices there is horizontal scroll in the table which I don't think is by spec

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 the idea of the overflowMode="Scroll" property of the ui5-table
As for our specs - we do not have it specified to not have a horizontal scroll.

Comment thread packages/main/test/pages/TabularInput.html Outdated
</div>

<!-- Example 6: Value States -->
<div class="section">

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.

The value state samples are broken - no table suggestions are shown. If I set a value state to the first table input sample - it works.
Also pressing Ctrl + Alt + F8 focuses an ui5-link in the value state message popup, but once the link is focused - pressing TAB does nothing and the focus remains trapped in the value state popup. For value state header it works

@ndeshev ndeshev Jul 20, 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.

It is not broken, there are no examples with value state and showSuggestions property set to true, I will add such.

I fixed the link tab navigation.

@ndeshev

ndeshev commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author
  1. There is a shadow in the input when the focus goes to a table row.
  1. Also, hovering on the input now displays a border around the input but it is a wrong color - it should be blue
  1. When table is rendered in the popover, the table header top border and last row bottom border are applied next to the popover border and the top and bottom popover border looks thicker

Fixed

nikoletavnv
nikoletavnv previously approved these changes Jul 23, 2026
@ndeshev
ndeshev temporarily deployed to netlify-preview July 23, 2026 13:04 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown

👋 Heads-up: dev close is in effect

Thanks for the contribution! This repository is currently in dev close ahead of release 2.25 (scheduled 2026-07-29, UTC). See the release schedule for the full timeline.

This PR appears to introduce public-API changes (detected by diffing the Custom Elements Manifest against the latest published version on npm):

@ui5/webcomponents

  • ➕ added interface: ITabularSuggestionRow
  • ➕ added element: TabularInput
  • ➕ added property: accessibleDescription
  • ➕ added property: accessibleDescriptionRef
  • ➕ added property: accessibleName
  • ➕ added property: accessibleNameRef
  • ➕ added property: disabled
  • ➕ added property: filter
  • ➕ added property: maxlength
  • ➕ added property: name
  • ➕ added property: noTypeahead
  • ➕ added property: open
  • ➕ added property: placeholder
  • ➕ added property: readonly
  • ➕ added property: required
  • ➕ added property: showClearIcon
  • ➕ added property: showSuggestions
  • ➕ added property: type
  • ➕ added property: value
  • ➕ added property: valueState
  • ➕ added event: change
  • ➕ added event: close
  • ➕ added event: input
  • ➕ added event: open
  • ➕ added event: select
  • ➕ added event: selection-change
  • ➕ added slot: default
  • ➕ added slot: icon
  • ➕ added slot: suggestionColumns
  • ➕ added slot: suggestionRows
  • ➕ added slot: valueStateMessage
  • ➕ added CSS part: clear-icon
  • ➕ added CSS part: input
  • ➕ added CSS part: root
  • ➕ added attribute: accessible-description
  • ➕ added attribute: accessible-description-ref
  • ➕ added attribute: accessible-name
  • ➕ added attribute: accessible-name-ref
  • ➕ added attribute: disabled
  • ➕ added attribute: filter
  • ➕ added attribute: maxlength
  • ➕ added attribute: name
  • ➕ added attribute: no-typeahead
  • ➕ added attribute: open
  • ➕ added attribute: placeholder
  • ➕ added attribute: readonly
  • ➕ added attribute: required
  • ➕ added attribute: show-clear-icon
  • ➕ added attribute: show-suggestions
  • ➕ added attribute: type
  • ➕ added attribute: value
  • ➕ added attribute: value-state

Could you please hold off on merging into main until the release ships? Public-API changes are best landed in the next dev cycle so they don't slip into the release at the last minute. Once the release is out, this PR is good to go.

If this change must ship in the current release, please request a review from one or two members of @UI5/ui5-team-webc so the team can sign off explicitly.

💬 False positive? If you believe this PR doesn't actually change the public API (e.g. only internal refactoring, or an entry the detector mis-attributed), please reply on this thread — your feedback helps us improve the detection during this trial run.

Posted automatically by the Dev Close Notice workflow.

@ndeshev ndeshev changed the title feat(ui5-tabular-input): introduce new tabular suggestions input feat(ui5-input-table-suggest): introduce new InputTableSuggest component Jul 23, 2026
@ndeshev
ndeshev force-pushed the input-tabular-suggestions-alt branch from 372efd9 to 4f793f9 Compare July 23, 2026 15:17
@ndeshev
ndeshev temporarily deployed to netlify-preview July 23, 2026 15:17 — with GitHub Actions Inactive
@ndeshev
ndeshev temporarily deployed to netlify-preview July 23, 2026 15:18 — with GitHub Actions Inactive
@ndeshev
ndeshev force-pushed the input-tabular-suggestions-alt branch from 0859076 to f30f39e Compare July 23, 2026 15:26
@ndeshev
ndeshev temporarily deployed to netlify-preview July 23, 2026 15:26 — with GitHub Actions Inactive
@ndeshev
ndeshev temporarily deployed to netlify-preview July 23, 2026 15:28 — with GitHub Actions Inactive
@ndeshev
ndeshev temporarily deployed to netlify-preview July 24, 2026 10:17 — with GitHub Actions Inactive
@ndeshev
ndeshev temporarily deployed to netlify-preview July 24, 2026 10:18 — with GitHub Actions Inactive
@ndeshev
ndeshev marked this pull request as draft July 24, 2026 13:46
refactor ui-input to ui5-input-field and ui5-input for list suggestions functionality,
ui5-input-table-suggest now extends ui5-input-field to avoid inheriting redundant logic
@ndeshev
ndeshev force-pushed the input-tabular-suggestions-alt branch from fbd4d49 to 366d4a4 Compare July 30, 2026 09:22
@ndeshev
ndeshev temporarily deployed to netlify-preview July 30, 2026 09:27 — with GitHub Actions Inactive
@ndeshev
ndeshev temporarily deployed to netlify-preview July 30, 2026 16:58 — with GitHub Actions Inactive
@ndeshev
ndeshev temporarily deployed to netlify-preview July 31, 2026 04:34 — with GitHub Actions Inactive
@ndeshev
ndeshev temporarily deployed to netlify-preview August 2, 2026 05:06 — with GitHub Actions Inactive
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.

2 participants