Visitar URL original
feat(ui5-time-picker, ui5-datetime-picker): switch to inputs view at high zoom by Todor-ads · Pull Request #14282 · UI5/webcomponents · GitHub
Skip to content

feat(ui5-time-picker, ui5-datetime-picker): switch to inputs view at high zoom - #14282

Open
Todor-ads wants to merge 1 commit into
mainfrom
timepicker_zoom
Open

Todor-ads wants to merge 1 commit into
mainfrom
timepicker_zoom

Conversation

@Todor-ads

Copy link
Copy Markdown
Contributor

When the viewport is narrower than 300 px, clock pickers are replaced by numeric inputs and the mode-toggle button is hidden

…high zoom

When the viewport is narrower than 300 px (browser zoom > ~330 %),
clock pickers are replaced by numeric inputs and the mode-toggle button
is hidden. The AM/PM SegmentedButton is displayed correctly in the
inputs view by giving the TimeSelectionInputs host a definite width so
that flex-basis:100% on the AM/PM cell resolves and wraps to its own
row instead of overflowing the popup.
@Todor-ads
Todor-ads deployed to netlify-preview November 11, 2026 07:33 — with GitHub Actions Active
@Todor-ads
Todor-ads requested a review from GDamyanov November 11, 2026 07:33
@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.29 (scheduled 2026-11-18, 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

  • 🔄 changed attribute primary-calendar-type (type)
  • 🔄 changed attribute secondary-calendar-type (type)
  • 🔄 changed attribute value-state (type)
  • 🔄 changed attribute value-state (type)

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.

@sap-ui5-webcomponents-release

Copy link
Copy Markdown

}

_handleResize() {
this._highZoom = document.body.offsetWidth < HIGH_ZOOM_BREAKPOINT;

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.

This is duplicated logic so I would suggest to extract a util in base package (packages/base/src/util/HighZoomUtil.ts) whiich will be reused

_dateTimeSwitchChange(e: CustomEvent<SegmentedButtonSelectionChangeEventDetail>) { // Note: fix when SegmentedButton is implemented in TS
const selectedItem = e.detail.selectedItems[0];
this._showTimeView = selectedItem.getAttribute("data-ui5-key") === "Time";
this._useTimeInputs = false;

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 dont think that here we should reset _useTimeInputs, it should be reset when the popover is closed or date & time is selected

id={`${this._id}-mode-toggle`}
slot="endContent"
design="Transparent"
icon={this._effectiveUseInputs ? timeEntryRequest : keyboardAndMouse}

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.

should be _useInputs instead of _effectiveUseInputs

});
});

describe("TimePicker at high zoom (viewport < 300 px)", () => {

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.

High zoom on desktop (no ui5SimulateDevice) — the actual target scenario is missing

This branch was successfully deployed

1 active deployment
netlify-preview — 19fca29b Deployed Nov 11, 2026 by Todor-ads via deploy-preview #3731
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