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.
fixes #11888
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
Fixes https://github.com/vaadin/framework/issues/11970
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.
Closes #10338
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.
Fixes #9996
Fix an issue with frozen column count and unhiding. (#11929)
* Fix an issue with frozen column count and unhiding.
Unhiding logic should take into account that there can be hidden frozen
columns that are not the column currently getting shown.
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.
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.
Fixes #10734
Further tweaks to ComboBox popup positioning. (#11910)
* Further tweaks to ComboBox popup positioning.
- Updated a comment and renamed a private method for better clarity.
- Blocked unnecessary position updates.
- Added a test for #11866 / #11894.
* Removing code causing the trouble
Removing code that was apparently not needed in previous fix and caused regression
Fixes: https://github.com/vaadin/framework/issues/11895
* Added feature to test UI
* Added test case
* Adding missing import
* Fixing test UI
* Enable DateField
Fix logic of lexicographical comparison of DateField range end (#11885)
* Fix logic of lexicographical comparison of DateField range end
Fix logic of lexicographical comparison of DateField range end with large year numbers ( > 9999)
Fixes #11881
* Added tests
Purpose of dateFieldRangeYearDigitsIncrease() is to test that rangeEnd works correctly on 4 to 5 digits change boundary
Purpose of dateFieldRangeYearBigNumbersPopupOpens() is to test that popup opens also when there is more than 4 digits in year
* Fixing typo
* Add error message
* Set the date of the field in test
* Fixing
Don't reset date to current at DateField state (e.g. read-only) updates. (#11879)
- DateFields with month or year resolution should not get their date
reset to current date if the field's state is updated (e.g. by changing
read-only status or adding a range).
Fixes: #11864, #11605
Improvements to popup positioning for ComboBox within HorizontalLayout. (#11846)
Expand ratio and spacing can cause ComboBox to miscalculate its own
position while layouting is still ongoing. Popup should not be
repositioned in such circumstances in order to avoid incorrect
intermediate states.
Continues on #11718
Close window on ESC, when maximized button is clicked (#11840)
Fixes #11838
Changes:
1. Close a window when maximized button is focused and ESC is pressed
2. Add additional check for a close button to react to the ESC key press
3. Rename a private method `onCloseClick` to `closeWindow` to allow code re-use
If first attempt at scrolling doesn't succeed it's unlikely that
continuing to wait is going to make any difference. Cache should be
populated before triggering any actions that depend on the row being
visible, otherwise it should be enough to trust that scrollToRow
actually scrolls to row and once scrolling is done the row is as much in
view as it's going to get. This way we don't get into a situation where
Editor never opens because it's still waiting for that one last pixel
that can't be achieved thanks to browser zoom causing rounding errors.
Continues on #11672
Don't attempt to send expand/collapse events for disabled TreeGrid. (#11823)
The attempt gets blocked later down the line in any case and never
reaches the server, but sending it messes up TreeGrid's internal state.
It gets stuck waiting for the resolution of the blocked call that can
then only be resolved by server-side sending its own expand/collapse
request programmatically. Until that happens no further expand/collapse
attempts will get sent to server even after the TreeGrid has been
enabled again.
Tree is also affected as it is built upon TreeGrid.
Fixes #11822
Fixing issue with TwinColSelect not correctly retaining visible selection (#11799)
There is a bug in TwinColSelect loging, it retains selection by indexes not by values after being sorted when new item has been added. This is a fixed by changing updateListBox method to retain the selection as it is being called after selection is being done.
Fixes: #11287
Reduce excess positioning calls for ComboBox popup. (#11808)
- If an open popup is reset to its default position on every update from
the server before getting adjusted again to the actual expected
position, on heavier applications some of those intermediate positions
might get rendered. If the ComboBox is positioned at the right edge and
the popup contents are longer than the input field (i.e. popup should
open to the left, not right) this might cause flickering.
- Setting the default position is only actually needed when the popup is
opened in order to give it a baseline, otherwise it's better to simply
adjust the position if needed.
Continues on #11718
Fixing issue with Push stopping working in some circumstances (#11791)
* Fixing issue with Push stopping working in some circumstances
If new request is attempted when resynchronization is ongoing, the Push will stop working. This patch fixes the issue by aborting handleJson if resynch is already ongoing.
This PR supercedes https://github.com/vaadin/framework/pull/11786
Fixes #11702, #7719
* Call onResynchronize() in MessageHandler
* Optimizing
Check actual Grid selection instead of relying on allSelected flag. (#11787)
The checkbox for selecting all rows only selects all the rows that have
not been filtered out. Changing the filtering does not change the
selection or the checkbox state so assuming that all rows are selected
simply because the checkbox has been checked cannot work.
Fixes #11479
Fix a timing issue in ComboBox filtering via paste using mouse. (#11780)
The filtering needs to be delayed, otherwise it's performed before the
new filter text is available and the old filter text is used instead.
Fixes #11779
Switch from an assert to logging and return in Grid.onBrowserEvent (#11778)
- If the Grid has frozen columns zooming can cause the regular column
cells to be ever so slightly out of sync with their corresponding rows.
This difference is not noticeable to naked eye but is big enough that
it's possible to hover over the row instead of the cell, which causes an
assertion error and a big ugly error popup. Switching to logging retains
the information delivered by the assertion error for developer purposes
but makes the end user experience smoother.
- Can be tested manually with GridColumnFrozenColumn test UI.
Fixes #11198
Added 1px tolerance to ScrollbarBundle's internal sanity check. (#11777)
* Added 1px tolerance to ScrollbarBundle's internal sanity check.
Requiring exact match can cause this check to fail when the browser is
zoomed since rounding is involved. This can in turn block some features
like opening of Grid Editor from working until some more scrolling
happens and the minute inconsistency is fixed.
Can be tested manually using GridEditorUI, depending on the environment
different amounts of zooming may be required for the problem to
manifest.
Fixes #11672
Improvements to ScrollDestination sanity checks (#11772)
- The new top row logical index should always be within the logical
range and high enough up to avoid leaving a gap if possible.
- Added regression testing for using the different scroll destination
types for scrolling to the top and to the bottom by index.
Fixes #11732
Fix scrollTo for destination START and END and add regression testing. (#11707)
- Initial implementation erroneously assumed that
ScrollDestination.START would only be used for scrolling up and
ScrollDestination.END for scrolling down. That's obviously not what they
are for, otherwise everyone would be using ScrollDestination.ANY.
- Moved actual scrolling to within the helper method that originally
only calculated the new scroll position. Parent method became too long
otherwise.
Fixes #11706
Updated row and spacer handling for Escalator (#11438)
Updated row and spacer handling for Escalator.
Main changes:
- Spacers are only maintained and checked for rows that have DOM
representation, and not at all if there is no details generator. This
gives notable performance improvements to some particularly large Grids
- Escalator no longer tries to trim away any rows that don't fit within
the viewport just because a details row gets opened in Grid. This leads
to some increase in simultaneous DOM elements, but simplifies the logic
considerably. For example opening or closing details rows doesn't
require checking the overall content validity beyond the details row
itself anymore, but some repositioning at most. There are also no longer
any orphaned spacers without corresponding DOM rows.
- Spacers are better integrated into the overall position calculations.
- Some public methods that are no longer used by Escalator or have
changed functionality or order of operations. Any extending classes that
tap into row, spacer, or scroll position handling are likely to need
reworking after this update.
- Auto-detecting row height is delayed until Escalator is both attached
and displayed.
Apply offset to column index depending on presense of selection column (#11667)
* Apply offset to column index depending on presense of selection column
After testing this manually I noticed that offset correction needs to be negative
* Add the testing UI