Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct scrollable element check condition #7060

Open
wants to merge 326 commits into
base: main
Choose a base branch
from

Conversation

chirokas
Copy link
Contributor

Changed the logical operator from && to || because an element cannot be both document.documentElement and document.body at the same time.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

devongovett and others added 30 commits March 6, 2024 10:14
* update illustrated message font size

* remove v3 style props

* remove unneccessary styling

Co-authored-by: Yihui Liao <[email protected]>
* ActionMenu and positioning props for Menu
* Move Popover padding and add ref
* nextjs, macros, and components example app

* package.json link path to rainbow was wrong

* adding dropzone, taggroup, and illustratedmessage

* using the npmjs version of unplogin-parcel-macros instead of linking

* review feedback - config improvements

Co-authored-by: Kyle Taborski <[email protected]>
* Avatar audit + fix to style macro to omit overriden default styles

* removing avatars and isDisabled

* audit button and buttongroup

* more audit items

* Adding component descriptions

* Forgot to save

* update with spectrum links and help text type update

* properly only send DOM props to the Avatar

* fix help text related types

* update label type

* whoops too much empty space

* review comments
* I-P exports and descriptions
Menu has its own Divider so we can ensure style merge order (adobe#76)
* Use WF icons for InlineAlert

* change prop name back

* Get rid of cloneElement and use wrapper on context

* swap to svgr and work on inline alert

* fix sizing temporarily

* Update all icon usages

* inline styles, though i still think these are broken icons

* review comments

* update font colors of inline alert to match figma

Co-authored-by: Daniel Lu <[email protected]>
* update type for Divider

* update type for Dropzone

* update type for Form

* add JSDoc

* update Divider JSDoc

* Update Dropzone JSDoc

* add more JSDocs

* default Form size to M

* formatting

* add min height and width to divider based on orientation

* switch defaults to medium values

* update Divider large sizes

* remove validationBehavior from Form

* add PURE annotations

Co-authored-by: Reid Barber <[email protected]>
Co-authored-by: Rob Snow <[email protected]>
…ted, and other bug fixes (adobe#72)

* adding ActionButton truncation and fixing Taggroup icon color when selected

* fix icon only button sizing in ButtonGroup in safari

not sure why the minWidth is being applied to non icon only buttons though...

* Make help text not render anything if there isnt a error message to display when invalid

* fix dropzone replace mesage banner positioning in Safari

Co-authored-by: Rob Snow <[email protected]>
* update sizes to use auto instead of undefined

* add none to theme

* update to use none instead of auto

* update style logic

* Revert "add none to theme"

This reverts commit 4f552e74de94475dd3809063b3a18ae548b3e740.

* improve story

* remove minWidth and minHeight

Co-authored-by: Reid Barber <[email protected]>
* R-S audit

* RadioGroup api audit and radio props from form context

* renaming props and form props in radio

* adding pure

* updated comments and rest of files

* fixing a variable usage

Co-authored-by: Kyle Taborski <[email protected]>
snowystinger and others added 23 commits September 6, 2024 07:36
* Yarn publish nightlies and verdaccio
Label breadcrumb collapse menu
* fix treeview stories controls

* fix tree row padding if no checkbox and fix chromatic
* Fix icon builder dependencies
* replace Azure CLI with AzCopy

* use wget

* update command

* remove azure-cli image

* Revert "remove azure-cli image"

This reverts commit 07b7ed0.
* fix path in verdaccio deploy

* build on PR

* revert

* enable comments on PR

* loop over verdaccio dir

* add back branch filters
)

* Allow layout delegate to override shift selection behavior

* Fix virtualizer unmounting and remounting when changing layout options

* Automatically reduce card size based on available space

* Fix TS strict

---------

Co-authored-by: Daniel Lu <[email protected]>
* initialize segemented file

* add some styling

* add track styling and hcm

* fix hcm

* remove unused imports

* export properly, add font weight

* default select first item, fix hcm

* remove trackStyle prop

* remove more trackStyle stuff, update css

* update stories

* fix types, add jsdoc comments

* update story again oops

* fix typo

* fix types

* remove space

* add translation

* update internal context prop name, add transition

* remove transition, fix keyboard in rtl

* update string formatter

* initialize animations (it's very janky)

* require aria label, remove translation

* fix lint

* fix ts

* update props

* fix spacing

* add aria label to stories

* update animation using flip, fix selectedValue when radio group is disabled

* keep speed the same

* fix lint and small other fixes

* add icon only spacing

* update segmented control item prop name

* fix lint

* small fixes

* fix alignment with text and icons, fix wiggling for ltr

* fix wiggling in rtl languages

* update icon only buttons

* revert useRadioGroupState change

* revert changes to registration

* fix lint

---------

Co-authored-by: Robert Snow <[email protected]>
RAC and S2 Pending Button
Co-authored-by: Abel John <[email protected]>
Co-authored-by: Robert Snow <[email protected]>
Co-authored-by: Daniel Lu <[email protected]>
Co-authored-by: Teemu Andersèn <[email protected]>
Co-authored-by: Robert Snow <[email protected]>
Co-authored-by: Reid Barber <[email protected]>
Co-authored-by: Daniel Lu <[email protected]>
feat: forward styles to VirtualizerItem
@snowystinger
Copy link
Member

Was anything breaking with this? It'd be good to be able to verify the behavior update. This is a line from 4 years ago, so curious how you found it.

@chirokas
Copy link
Contributor Author

What I mean is that this could be a typo, and it should use the || operator to check conditions, just like in line 127. Also, from lines 127 to 130, it’s clear that in the onTouchStart event, if scrollable is either document.documentElement or document.body, there’s no need to handle with overscroll-behavior, since in the onTouchMove event, it will prevent the window from scrolling. If I got it wrong and it affected your work, I’m sorry about that.

@snowystinger
Copy link
Member

No no, you misunderstand. I haven't seen it adversely affect anything. I'm curious how you noticed it.

@chirokas
Copy link
Contributor Author

I’ve always been a fan of the React Spectrum library, so I like to dig into its source code whenever I have some free time. Recently, while debugging, I noticed that a specific if condition (on line 113) wasn’t being triggered, which got me curious. I started looking into it more, but now that I think about it, I might’ve messed something up in the process. I’m really sorry about that.

@chirokas
Copy link
Contributor Author

I still don’t get what scrollable === document.documentElement && scrollable === document.body (document.documentElement === document.body ?) means in the code. Can you explain it simply?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.