Anna Koskinen [Tue, 13 Apr 2021 13:24:21 +0000 (16:24 +0300)]
Fix Window dragging on touch screen. (#12260) (#12264)
* Fix Window dragging on touch screen. (#12260)
- Added check for touch move event in order to allow the same flow for
both mouse and touch events when dragging a Window by its header.
- Can be tested with SubwindowDraggability class.
Fixes #12257
Co-authored-by: Jakub Antoniak <j.antoniak8@gmail.com>
Tatu Lund [Thu, 18 Mar 2021 16:12:37 +0000 (18:12 +0200)]
feat: Add API to control whether Binder converts back to presentation (#12246)
#12132 fixed an old bug, conversion was not done back, which was a regression from Vaadin 7. However since the bug has been present long time, it has become established behavior, thus there may be need to disable conversion back to presentation sometimes, thus this API as added.
- Physical index should take into account that more than one row can
have a spacer. Physical index has no practical effect on how Grid looks
like or behaves, since Escalator by design operates independently of it
and the visual positioning of elements is based on the logical and
visual indices. Physical index only affects the order of elements
within the DOM tree, where a mismatch can cause confusion during
debugging.
Anna Koskinen [Mon, 8 Mar 2021 11:18:11 +0000 (13:18 +0200)]
Fix updating Grid's item set when details rows are open. (#12231)
- Old details should close.
- New details should open.
- If some row has details in both old and new item set, the details row
contents should get updated.
- Updating details row contents should not break the positioning of the
rows and details below.
Anna Koskinen [Wed, 3 Mar 2021 11:59:50 +0000 (13:59 +0200)]
Remove whitespace-maven-plugin and formatter-maven-plugin. (#12213)
- These plugins cause significant problems for many Windows developers,
and since most active maintainers are currently included in that group,
the plugins have been deemed more trouble than they are worth.
Anna Koskinen [Fri, 26 Feb 2021 13:49:47 +0000 (15:49 +0200)]
Merged column headers should work within declarative Grid. (#12206)
- null check to prevent NPE from the merged column headers
- convert to internal columnIds for merge handling
- use correct cell in merge handling
- switch away from streams in merge handling for easier readability
- regression test
Anna Koskinen [Thu, 11 Feb 2021 13:55:21 +0000 (15:55 +0200)]
Clear out ClientCache when UI is detached to prevent a minor memory leak (#12199)
* Clear out ClientCache when UI is detached to prevent a minor memory leak
Implemented with a listener rather than direct call from UI.detach() in
order to avoid new public API, since the whole feature has been marked
for removal. This doesn't yet prevent the cache or the type map from
getting slightly bloated during the UI's lifetime.
Tatu Lund [Fri, 29 Jan 2021 11:32:09 +0000 (13:32 +0200)]
fix: use time-constant comparison for security tokens (#12189)
This is the same as https://github.com/vaadin/framework/pull/12188,
but also applied for the upload security key
and the push id since both of those are also used to protect against
cross-site attacks. In addition, documentation for the push id is
clarified to point out its role.
Tatu Lund [Thu, 7 Jan 2021 11:21:46 +0000 (13:21 +0200)]
Move call to getMessageHandler().onResynchronize(); to right place (#12178)
https://github.com/vaadin/framework/pull/12043 changed resync message sending to be deferred to queue. Now also the setting of the semaphor in message handler needs to be deferred to its right place. Otherwise there is possibility for a timing glitch. I.e. MessageHandler is set to resync handling mode before message is actually send.
Anna Koskinen [Fri, 18 Dec 2020 11:16:26 +0000 (13:16 +0200)]
Fix to LayoutManager size calculations during transform. (#12138)
* Fix to LayoutManager size calculations during transform.
- ComputedStyle is slower but more reliable than using
getBoundingClientRect, which does not work as expected if a transform
has been applied to the element or one of its parents. This is a problem
e.g. with PopupView, where getBoundingClientRect will return too small
size (or even zero size) for all the popup contents while the opening
animation is active. ComputedStyle ignores the transform and returns the
expected value.
- The presence of the element in DOM must be checked before the size is
requested from ComputedStyle, if the element has disappeared from DOM
without a warning and calculation is attempted anyway, the browser gets
stuck.
- Possibility to configure LayoutManager to use the less reliable
calculations for applications where the slight performance difference is
more important than layout issues within elements that have transform
animations.
- Manual test, problem isn't reproducible by TestBench.
Anna Koskinen [Tue, 10 Nov 2020 09:51:25 +0000 (11:51 +0200)]
Tweaks to Grid/Escalator column size handling (#12145)
- ScrollbarBundle: removed delays in scroll handling that were only
needed for IE8, added possibility to update offsetSize and scrollSize at
the same time in order to avoid triggering unnecessary scrollbar
visibility change events during the intermediate state.
- ColumnConfigurator: added new method that allows setting column widths
without triggering element size recalculations.
- EscalatorProxy: added implementation of the new method to
ColumnConfigurationProxy.
- Escalator: switched to use new methods in ScrollbarBundle and
ColumnConfigurator, added a pixel to a scrollbar offsetSize calculation
that was for some reason consistently one pixel too low, removed
duplicate method calls from sectionHeightCalculated handling as those
are already handled by the calling method and can cause incorrect
intermediate state and unnecessary scrollbar visibility change events,
added implementation of the new method to ColumnConfigurationImpl with
the element size recalculations made optional.
- Grid: updated column minimum width calculations to take into account
the potential presence of a resize handle, updated expand ratio handling
to not trigger element size recalculations until the entire handling is
finished.
- Test for column width handling when there are multiple columns with
setMinimumWidthFromContent(false)
Tatu Lund [Thu, 22 Oct 2020 11:16:17 +0000 (14:16 +0300)]
Use generated id of the menu item to help testing of the menubar (#12124)
Use generated IDs for MenuItems when an ID is set for MenuBar. Tying the ID to MenuBar's ID helps with the possible case of having multiple MenuBars on the same view and avoids to have excess id's when not needed.
Anna Koskinen [Mon, 12 Oct 2020 11:42:40 +0000 (14:42 +0300)]
When a Grid gets scroll-locked, cancel the scrollInProgress handler. (#12116)
Otherwise opening a Grid editor can cause ApplicationConnection to get
stuck in 'active' state even if no actual scroll position processing is
ongoing, which in turn causes TestBench delays when it tries to wait
until ApplicationConnection indicates that everything necessary has been
processed.
Tatu Lund [Fri, 7 Aug 2020 14:39:23 +0000 (17:39 +0300)]
Explicitly remove old dataprovider listener when new one is set (#12064)
* Explicitly remove old dataprovider listener when new one is set
If not done, this can cause memory leakage
* Formatting
* Fixed coding style
* Take into account further scenarios
Component maybe detached permanently and thus data provider listener needs to be remove in detach. Also if this is only momentary remove from layout add back cycle, re-setup is needed in attach, in case it was not already setup before attaching by setDataProvider.
Anna Koskinen [Thu, 30 Jul 2020 10:01:44 +0000 (13:01 +0300)]
Use queue for resync requests. (#12043)
There might be pending requests in the queue when a resync request is
made (e.g. through a theme change). This can cause conflicts if the
resync request is handled immediately. Therefore the resync request
should also be added to the queue and only get resolved when
doSendInvocationsToServer() gets triggered again.
Anna Koskinen [Thu, 23 Jul 2020 10:27:11 +0000 (13:27 +0300)]
Add column width recalculation when vertical scrollbar hidden/shown. (#12058)
- If the Grid has any columns with non-fixed widths, the presence of a
vertical scrollbar affects the column width calculations. Horizontal
scrollbar should only be shown when actually needed.
Tatu Lund [Fri, 3 Jul 2020 10:17:34 +0000 (13:17 +0300)]
Add support for "ww" in date format (#12037)
Calculate number of the week in the year based on Date. Note, support for "ww" is missing from GWT DateTimeFormat and java.util.Calendar is not supported in GWT, hence DIY method is needed.