Paul Capron [Wed, 14 Oct 2020 21:53:11 +0000 (23:53 +0200)]
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 d3025968f34 introduced a regression by testing with `!== "hidden"`
instead of `=== "visible"`.
Fix for `options === true` when using jQuery UI under `use strict`,
which throws:
```
Uncaught TypeError: Cannot create property 'complete' on boolean 'true'
```
on line:
```js
options.complete = callback;
```
jQuery >=3.2 doesn't include scrollbars in `.height()`, this commit switches
it to `.innerHeight()` which does so in jQuery >=3.3. In jQuery 3.2 it doesn't
either so include scrollbars in innerHeight, add it back.
Using `.innerHeight()` instead of `.height()` should be fine as menu doesn't
define padding styles.
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>
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.
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.
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`.
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.
OskarNS [Mon, 9 Dec 2019 20:11:13 +0000 (21:11 +0100)]
Datepicker: Fix typo in currentText in da localization
The term for "Today" in Danish is "I dag" not "Idag". This is a common misspelling in the Danish language.
see https://dsn.dk/?retskriv=idag
Dansk Sprognævn (DSN) is the authority over the Danish language.
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)
Scott González [Thu, 11 May 2017 17:58:08 +0000 (13:58 -0400)]
Dialog: Fix shared event handler for modal dialogs
The old logic worked when all widgets of the same type used the same
event namespace. However, now that each instance has its own namespace,
we cannot use `_on()` for shared event handlers.
A. Wells [Thu, 16 Feb 2017 18:48:45 +0000 (13:48 -0500)]
Sortable: Fix various scrolling issues
* Created _scroll extension point and migrated scroll code from _mouseDrag
* Cleaned up logic for scrolled
* Fixed appendTo functionality to match documentation
* Remove unnecessary function calls
* Move set-up position functions to appropriate place
* Base scrollParent on placeholder and not helper
* Update scrollParent when switching containers
Ryan Oriecuia [Thu, 12 Jan 2017 19:16:20 +0000 (11:16 -0800)]
Autocomplete: Fix IE/Edge scrolling issues
IE11 and scrolling autocompletes didn't get along great; this should help fix
their relationship.
When you click on an autocomplete scrollbar in IE11, the menu temporarily
gains focus, which caused a couple problems.
1. Depending on how long you clicked, the dropdown could close.
2. Scrolling down by clicking the scrollbar's down arrow would misbehave. The
list would pop back up to the top with the first item selected.
We can fix both problems by modifying the focus/blur handling a bit.
1. There is a flag to instruct the control to ignore blurs, but it was getting
cleared too quickly; when the code refocused the input after it was blurred,
IE would send *another* blur event, which wasn't getting ignored and would
close the dropdown. We now wait for the focus/blur pair to process before
clearing the flag.
2. We remove the tabindex from the dropdown menu, which prevents menu's focus
handler from firing. When you focus a menu, it will select the first menu item
if none are selected. Selecting a menu item will scroll it into view if it's
not visible. This combination of behaviors was causing the strange behavior
when attempting to scroll down.
I couldn't figure out a way to write a unit test for this, since it's IE only
and seems to require user interaction. You can verify the previous behavior
(and the fix) on `demos/autocomplete/maxheight.html`
Node.js 0.12 loses upstream support at the end of 2016, while Node 6 is in the
Active support phase until 2018-04-18 and will receive security fixes until
2019-04-18.
Ryan Oriecuia [Tue, 16 Aug 2016 23:52:15 +0000 (16:52 -0700)]
Draggable: Fix spurious blur in dialogs on mousedown
I was running into a problem with a popup menu control in a dialog; clicks
weren't working (but keyboard was working fine). It turned out that the menu
was getting destroyed before the click event could fire.
Tracked down the issue to the way draggable blurs focused controls; it was
doing the blur before it ran through the logic to figure out if the drag was
actually on the handle. I've moved the blur below these checks, so it'll only
blur things if it actually needs to handle the drag. Otherwise, it asserts no
opinion on what should and shouldn't be focused, which seems like the way
things ought to be.
Also, added a unit test to check for the expected behavior.