Commit Graph

2617 Commits

Author SHA1 Message Date
Patrick McKay
17d115b829 Datepicker: Add option for onUpdateDatepicker callback
Add a new option named onUpdateDatepicker that allows a custom callback
to be provided. If provided, the callback is called at the end of
$.datepicker._updateDatepicker.
2021-05-21 17:58:10 +02:00
Michał Gołębiowski-Owczarek
7c6a9f0128
All: Drop $.ui.escapeSelector in favor of $.escapeSelector
Fixes #14991
Closes gh-1957
2021-05-14 23:37:19 +02:00
Michał Gołębiowski-Owczarek
afe20b79a6
Datepicker: Make sure text option are text, shorten HTML strings
Instead of using enormous HTML strings, various elements are now constructed
using jQuery APIs. This makes it more obvious user-provided data is used
correctly.

Fixes #15284
Closes gh-1953
2021-05-12 00:59:42 +02:00
Michał Gołębiowski-Owczarek
effa323f15
Position: Make sure of is treated as a CSS selector
Closes gh-1955
2021-05-04 13:31:39 +02:00
Michał Gołębiowski-Owczarek
32850869d3
Datepicker: Make sure altField is treated as a CSS selector
Closes gh-1954
2021-05-04 13:30:06 +02:00
Michał Gołębiowski-Owczarek
9380d2734e
Tests: Accept delayed focusout in IE with jQuery 1.8
In IE with jQuery 1.8 focusout may not happen immediately so some checks
need to be done later.

Closes gh-1952
2021-04-16 23:33:57 +02:00
Michał Gołębiowski-Owczarek
dff0dc0d6a
Tests: Fix the "dialog: core: focus tabbable" test in IE
In IE in jQuery 3.4+ a sequence:
```js
$( inputNode ).trigger( "focus" ).trigger( "blur" ).trigger( "focus" );
```
doesn't end up with a focused input. However, in this test we only want to check
that the last focused input receives the focus back when `_focusTabbable()` is
called which in reality doesn't happen so quickly so let's avoid the issue by
waiting a bit.

Ref jquery/jquery#4856
Closes gh-1951
2021-03-16 22:17:25 +01:00
Michał Gołębiowski-Owczarek
9ea690a0d9
Tests: Make some number comparisons less strict
Some of the APIs return fractional values in newer jQueries, making comparisons
sometimes not being 100% accurate. Allow some delta.

This is similar to what was already done in
98b539171b but a few cases affecting IE and/or
Edge Legacy were missed.

Closes gh-1947
2021-03-09 00:11:40 +01:00
Michał Gołębiowski-Owczarek
e6592a8aff
Build: Add jQuery 3.6.0, update Migrate from 3.3.1 to 3.3.2
Closes gh-1948
2021-03-09 00:09:51 +01:00
Michał Gołębiowski-Owczarek
5b5fda7cd2
Tests: Account for an extra noop focus/blur listener in jQuery >=3.4
jQuery >=3.4.0 uses a special focus/blur handler pair needed to fix various
issues with checkboxes/radio buttons as well as being able to pass data in focus
triggers. This leaves extra focus & blur events if any of these events were ever
listened to at a particular element.

We've started skipping these handlers in the `domEqual` assertion in gh-1930 but
we missed a case where an event is triggered before any handler is attached -
jQuery >=3.4.0 attaches then an extra noop listener just to force the code path
to go through the setup code before the trigger happens. We now skip this extra
handler as well.

This fixes a test failure in "dialog: methods" destroy tests.

Closes gh-1945
Ref jquery/jquery#4496
Ref gh-1930
2021-02-20 19:11:03 +01:00
Micah Miller
a22361dbe4 Build: Update to the latest version of Grunt & many other packages
JSHint, JSCS & QUnit-related packages are not updated as they need more code
adjustments.

Fixes #15112
Closes gh-1882
2020-10-14 23:55:35 +02:00
Paul Capron
f5d38e2e05
Focusable: Fix handling of visibility: collapse
"collapse" is similar to "hidden", with a slight difference in the case
of tr/tbody/td/colgroup elements.
See https://www.w3.org/TR/CSS22/visufx.html#visibility
See https://www.w3.org/TR/CSS22/tables.html#dynamic-effects
See https://developer.mozilla.org/en-US/docs/Web/CSS/visibility#Table_example

"visibility: collapse" elements are always not focusable, though.

Commit d3025968f3 introduced a regression by testing with `!== "hidden"`
instead of `=== "visible"`.

Closes gh-1843
2020-10-14 23:53:11 +02:00
Michał Gołębiowski-Owczarek
d2f577f13b
Tests: Update jQuery Migrate from 3.3.0 to 3.3.1
That upgrade makes UI pass the whole test suite without a single jQuery Migrate
warning. 🎉

Closes gh-1932
2020-07-27 21:03:48 +02:00
Michał Gołębiowski-Owczarek
5e2fc44c0c
Tests: Account for extra focus/blur listeners in jQuery >=3.4
jQuery >=3.4.0 uses a special focus/blur handler pair
needed to fix various issues with checkboxes/radio buttons
as well as being able to pass data in focus triggers.
However, this leaves dummy focus & blur events if any of these
events were ever listened to at a particular element. There's not
a lot UI can do to fix this so we now just skip these handlers for
data comparisons in tests.

Ref jquery/jquery#4496
Closes gh-1930

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
2020-07-23 15:54:16 +02:00
Michał Gołębiowski-Owczarek
91037d66b0
Tests: Accept a small difference of animated width/height
jQuery 3.2 & newer have a different animation logic and the animated elements
width/height differ from the starting ones even at the beginning of the
animation. The point of the assertions checking that they're identical was
to ensure bug #5245 is fixed; that issue manifested by a big jump to half the
element size. To test for that, it's enough to check that the first obtained
values are close to the original ones.

This makes effects tests pass in all supported jQuery versions.

Closes gh-1928
Ref #5245
2020-07-23 15:53:36 +02:00
Michał Gołębiowski-Owczarek
b8ec78a37a
Tests: Skip a scrollbar test in jQuery 3.2
jQuery 3.2 incorrectly handle scrollbars in WebKit/Blink-based browsers.
This is fixed in version 3.3, see https://github.com/jquery/jquery/issues/3589.
As the data here comes from jQuery directly and the changes to fix it
are non-trivial: https://github.com/jquery/jquery/pull/3656, just accept
that scrollbar data in this jQuery version is inaccurate.

Closes gh-1927
Ref jquery/jquery#3589
Ref jquery/jquery#3656
2020-07-23 15:51:15 +02:00
Michał Gołębiowski-Owczarek
42bcdb90f6
Tests: Clear the timers queue in an animateClass test
jQueries older than 1.11 or 2.1 were leaving a timer in the queue which could
then influence other tests.

Closes gh-1926
2020-07-23 15:49:27 +02:00
Michał Gołębiowski-Owczarek
b61b16b5a8
All: Drop support for jQuery 1.7
Closes gh-1923
2020-07-22 16:04:47 +02:00
Michał Gołębiowski-Owczarek
e7a10c70ae
Tests: Ensure no timers are running at the end of each test (#1920)
This helps fix issues that make tooltip tests sometimes fail when run against
jQuery 3.2 or newer due to timing differences.

Details:
* Add the `moduleAfterEach` function ensuring no timers are running.
* Attach this function via `common.testWidget`.
* Attach this function to most test suites.
* Add a tooltip test helper cleaning up leftover timers.
* Rename legacy `setup`/`teardown` hooks to `beforeEach`/`afterEach`.

Closes gh-1920
2020-05-16 09:16:24 +02:00
Michał Gołębiowski-Owczarek
f4ef03e57e
All: Resolve most jQuery Migrate warnings
Closes gh-1919
2020-05-16 08:36:55 +02:00
Michał Gołębiowski-Owczarek
b36d542569
Tests: Load jQuery Migrate before UI test files
This is necessary to catch all possible warnings that the test files
may trigger.

Closes gh-1918
2020-05-16 08:30:11 +02:00
Michał Gołębiowski-Owczarek
7caf8f61df
Build: Rename jquery-1-7 to jquery-patch
The file now contains many more than just jQuery 1.7 patches.

Closes gh-1917
2020-05-16 08:29:08 +02:00
Michał Gołębiowski-Owczarek
579bedd7d2
Tests: Solve a frequent race condition in tests in Chrome/Safari
Closes gh-1916
2020-05-16 08:28:26 +02:00
Michał Gołębiowski-Owczarek
d37ebc624d
Build: Add jQuery 3.5.0 & 3.5.1
Closes gh-1915
2020-05-16 08:27:27 +02:00
Michał Gołębiowski-Owczarek
512cbbf4d9
Build: Update jQuery Simulate, jQuery Migrate & jQuery Color
The jQuery Simulate & jQuery Color updates are needed for compatibility
with jQuery master, a future jQuery 4.

Closes gh-1914
2020-05-16 08:26:48 +02:00
jigar gala
817ce38555 Datepicker: Fixed current instance memory leak and added unit testcases 2020-03-23 21:49:23 +01:00
Michał Gołębiowski-Owczarek
0c860b0d92
All: Remove usage of jQuery positional selectors
jQuery positional selectors () have been deprecated in
[jQuery 3.4.0](https://blog.jquery.com/2019/04/10/jquery-3-4-0-released/)
and they'll be removed in jQuery 4.0.0. This PR removes their usage.

Most of the changes were possible without changing public API. However,
dropping `:even` usage required a change to the
[`header` option](https://api.jqueryui.com/accordion/#option-header)
of the accordion widget. I made it an optional function; this will need
to be documented.

The polyfill for `.even()` & `.odd()` is added for jQuery <3.5.0. There was
no usage of the :odd selector in the code but the `.odd()` method is also
polyfilled for completeness.

Closes gh-1904
2020-01-22 16:44:34 +01:00
Michał Gołębiowski-Owczarek
3481f50bfc Tests: Add the 3.x-git jQuery version to the dropdown
Closes gh-1905
2020-01-14 14:03:23 +01:00
Michał Gołębiowski-Owczarek
98b539171b All: Migrate away from deprecated/removed Core APIs
Summary of the changes:

* Build: Add jQuery 3.2.0-3.4.1 to versions UI can be tested against
* Build: Load jQuery & Migrate via HTTPS
* Build: Add package-lock.json to .gitignore
* Build: Update jQuery Migrate from 3.0.0 to 3.1.0
* Build: Allow to run tests against jQuery 3.x-git
* Build: Fix formatting according to JSCS rules
* Build: Disable JSCS for the inlined jQuery Color
* All: Switch from $.isArray to Array.isArray (jQuery.isArray will be
  removed in jQuery 4.0)
* All: Switch from `$.isFunction( x )` to `typeof x === "function"`
  (jQuery.isFunction will be removed in jQuery 4.0)
* All: Inline jQuery.isWindow as it'll be removed in jQuery 4.0
* Effects: Fix a timing issue in a variable declaration. Previously,
  a jQuery object was created, chained & assigned to a variable that
  was then accessed in a callback used inside of this chained
  definition. Due to a timing difference in when the callback fired for
  the first time in latest jQuery master, it was being called before
  the variable was defined.
* Tests: Make dialog & draggable unit tests less strict (newest jQuery
  returns fractional results in some cases, making comparisons fail when
  there's a tiny difference)
* All: Migrate from $.trim to bare String.prototype.trim (jQuery.trim
  will be deprecated in jQuery 3.5)

Closes gh-1901
2019-12-08 22:23:08 +01:00
Scott González
74f8a0ac95 Tests: Load jquery-1-7 before other modules 2017-05-31 14:09:05 -04:00
Scott González
0940cb9bd2 All: Remove uses of jQuery.camelCase()
Ref #15160
Ref gh-1813
2017-05-17 11:17:09 -04:00
Scott González
ae31f2b3b4 Tests: Load jquery-1-7 module for jQuery 2.x as well 2017-05-15 18:24:19 -04:00
Scott González
39bbe70b54 Tests: Load the jquery-1-7 module for all 1.x versions 2017-05-10 09:02:53 -04:00
Scott González
50efd6e1b0 Menu: Ignore mouse events triggered due to page scrolling
Fixes #9356
Closes gh-1806
2017-05-02 15:16:17 -04:00
Scott González
a3e953b495 Menu: Don't focus dividers when wrapping via keyboard navigation
Fixes #15157
Closes gh-1804
2017-05-02 15:12:04 -04:00
Alexander Schmitz
abc9e7ce2f Button: Fix backcompat when called on collection of mixed elements
Fixes #15109
Closes gh-1808
2017-05-02 15:11:24 -04:00
Scott González
adcf9b6f6e Labels: Handle empty sets
Fixes #15184
2017-05-02 12:42:49 -04:00
Scott González
0d25a36eec Menu: Close menus immediately on selection or click outside
Fixes #15034
Closes gh-1807
2017-04-25 06:33:00 -04:00
Scott González
b3c0a7f71d Widget: Handle Object.create(null) for options objects
Fixes #15179
Closes gh-1809
2017-04-24 12:41:29 -04:00
Konstantin Dinev
c426b9a203 Resizable: Keep user-provided handles on destroy
Closes gh-1798
Ref gh-1795
2017-04-17 14:58:12 -04:00
Konstantin Dinev
278d1e1108 Resizable: Keep user defined handles on _setOption
Fixes #15084
Closes gh-1795
2017-02-24 14:30:58 -05:00
Scott González
a3b9129be1 Spinner: Ignore mousewheel events when not focused
Fixes #15139
Closes gh-1794
2017-02-21 12:45:19 -05:00
Scott González
162377fba2 Build: Add missing semicolon 2017-02-06 10:20:50 -05:00
Eirik Sletteberg
4fa0267edc Qunit: Add bootstrap config for running tests with jQuery Migrate
Closes gh-1774
2017-02-06 08:23:18 -05:00
Scott González
a2b25ef6ca Selectmenu: Don't render options with the hidden attribute
Fixes #15098
2016-11-16 12:52:15 -05:00
Michał Gołębiowski
4673c8808b Build: Add jQuery 3.1.1
Closes gh-1766
2016-11-02 12:52:22 -04:00
Scott González
0627eb3645 Form: Rename from .form() to ._form() since its not for public use
Fixes #15074
Closes gh-1760
2016-10-11 10:15:04 -04:00
Kevin Cupp
87eab46a58 Sortable: Setting table row placeholder height to be same as sorted row
Fixes #13662
Closes gh-1578
2016-10-04 15:22:14 -04:00
milk54
b9ffc34710 Tabs: Remove presentation role
Fixes #10122
Closes gh-1748
2016-09-29 10:15:19 -04:00
Sergei Ratnikov
c481400f22 Resizable: Fix aspectRatio cannot be changed after initialization.
Fixes #4186
Closes gh-1750
2016-09-28 11:55:13 -04:00