Anna Koskinen [Tue, 1 Dec 2020 12:46:27 +0000 (14:46 +0200)]
Tweaks to Grid/Escalator column size handling (#12145) (#12157)
- 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)
Anna Koskinen [Tue, 1 Dec 2020 12:35:24 +0000 (14:35 +0200)]
Use generated id of the menu item to help testing of the menubar (#12124) (#12156)
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.
Fixes: https://github.com/vaadin/framework/issues/8186 Authored-by: Tatu Lund <tatu@vaadin.com>
Anna Koskinen [Tue, 20 Oct 2020 10:54:42 +0000 (13:54 +0300)]
When a Grid gets scroll-locked, cancel the scrollInProgress handler. (#12116) (#12127)
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.
Anna Koskinen [Tue, 19 May 2020 10:13:25 +0000 (13:13 +0300)]
Table / TreeTable multiselect disabling of touch detection (#12014)
Added a toggle in Table (and thus TreeTable) where you can explicitly
disable multiselect touch screen detection. This allows you to work
around issues on hybrid devices that have both a touch screen and a
keyboard where you don't want automatic simple multiselection applied.
Fixes #11601, slightly modified cherry-pick of #11641
Tatu Lund [Thu, 14 May 2020 12:02:58 +0000 (15:02 +0300)]
Catch exception that is thrown when Grid is scrolled during operation (#12002)
IllegalStateException may occur if user has scrolled Grid (compatibility library version) so that Escalator has updated, and row under Editor is no longer there
Chrerry pick from https://github.com/vaadin/framework/pull/11467
Tarek Oraby [Fri, 8 May 2020 12:46:59 +0000 (15:46 +0300)]
Fix RTA's CreateLink in Firefox & IE11 (#11979)
In Firefox and IE11, the 'Create Link' button of the RichTextArea (RTA) only works by turning some highlighted text into a link (by adding the inserted URI as the href property of the text). In that, the RTA in these two browsers behave similarly to the way it does in Chrome and Edge. However, in Firefox and IE11, clicking the 'Create Link' button has no effect if no text is pre-selected by the user. This is different from the button's behavior in Chrome and Edge where the user's provided URI is inserted, both, as the displayed text and its href property if no text is highlighted.
This fix enables the RTA's 'Create Link' button to work consistently across the supported browsers. Specifically, (and in addition to enabling adding the href property of a highlighted text), this fix enables Firefox and IE11 to also insert a new Uri as a text and its href property if no text is already highlighted.
Tatu Lund [Tue, 28 Apr 2020 10:12:08 +0000 (13:12 +0300)]
Fix hiding / un-hiding with frozen columns in multiselect mode (#11972)
The previous patch https://github.com/vaadin/framework/pull/11951 did fix the problem (frozen column indicator wrongly positioned) it was meant to, but caused a regression in hiding / un-hiding.
This new fix addresses both problems, i.e. it applies multiselect column compensation in other way, without causing problem in hiding / un-hiding logic
Tree class doesn't currently provide an obvious way that would enable a Tree object to be treated as a multi select. This commit extends the Tree API, enabling it to be used as a multi select, which would importantly facilitate the selection/deselection of multiple items in trees whose SelectionMode is MULTI.
Allow AbstractDateField to provide DST zone names over custom ranges (#11927)
DateTimeField and DateField currently implement a hardcoded logic by which they adjust their time zone names to display daylight-saving time (DST) zone names. Specifically, this hardcoded logic only adjusts the displayed date to DST format if that date falls in one of the years between 1980 and the following 20 years in the future from the current date (that is, until 2040 at the time of this commit).
For some use cases, this is problematic because it is desirable to display proper DST-adjusted time zones beyond the 20 years limit (and possibly also before 1980).
Rather than choosing another arbitrary, hardcoded threshold, this commit extends the AbstractDateField API to allow the user to choose the range (start and end years) between which the DST transition dates are calculated (and hence displayed properly). If the user doesn't invoke this new API, DateTimeField and DateField will default to behave according the existing logic (i.e. display DST zone names between 1980 and 20 years into the future).
Tatu Lund [Tue, 7 Apr 2020 13:38:44 +0000 (16:38 +0300)]
Determine Push transport before re-connect (#11884)
onConnect was allways called with websocket = false. I think this is wrong, since if there was connection loss in websocket, now connection cannot be re-established in websocket mode.
Fixes: https://github.com/vaadin/framework/issues/11299
This bug may have been manifesting in other ways as well
Recently similar fix was done in Flow as well, see: https://github.com/vaadin/flow/pull/7489
Fix sanitization of empty RTA input for Firefox & IE (#11937)
Browsers differ in what they return as the content of a visually empty rich text area (RTA). Accordingly, RTA sanitizes these different values ensuring an empty string is returned to the framework. However, existing sanitization criteria doesn't work for Firefox 74 and Internet Explorer 11.
This fix appends the sanitization criteria of Firefox 74 and IE 11, ensuring an empty string is returned to the framework for a a visually empty RTA.