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.
Anna Koskinen [Tue, 31 Mar 2020 10:47:28 +0000 (13:47 +0300)]
Ensure recalculateColumnWidths works with refreshAll. (#11934)
Column widths shouldn't be calculated between the clearing of cache and
re-populating it, but be delayed until the cache has some content again.
The calculations should only be triggered immediately if no rows are
expected.
Anna Koskinen [Mon, 23 Mar 2020 09:01:25 +0000 (11:01 +0200)]
Simplify Grid sidebar handling. (#11920)
There is no need to reset the sidebar for every column that is set
hidable within the same roundtrip. Because no other layouting depends on
the sidebar contents, we can safely delay the reset until all columns
have got their hidabiity status updated. As a bonus point, when the
reset itself is delayed, the headers have time to get populated and the
sidebar button's height can be determined immediately at attach. The
reset ensures that attach is called every time a column's hidability is
changed.
Anna Koskinen [Mon, 9 Mar 2020 14:54:13 +0000 (16:54 +0200)]
Trigger re-measure after updating ElementResizeListeners. (#11912)
Removing ElementResizeListeners from an element makes it unmeasurable
and clears any saved measured values. Adding the listeners back makes
the element measurable again but doesn't add it to measuring queue.
Measuring needs to happen or any updates to expanded components within a
layout (without changes that would trigger full re-measuring of the
layout itself) lead to broken expand size calculations with any fixed
size elements assumed to have no size.