Ghost/apps/admin-x-design-system
Cathy Sarisky ebd98d005a
🐛 fix Windows bug with the admin file upload widget (#21687)
closes #21439

On Windows 10/Chrome (but maybe nowhere else?), attempting to drag a
file into any of the drop targets in the admin panel resulted in
flickering behavior, and generally dropping didn't actually trigger the
upload.

I thought originally it was a problem with the size of the drop target,
but it actually appears to be a rerender bug. In brief, handleDragging
and handleStopDragging were firing repeatedly, and each fire triggered a
rerender, that added or removed a div from the file upload widget.

I suspect some browser-specific difference in how drag events fire is to
blame.

This PR moves the logic to change the classes applied to the div, rather
than changing whether the div is present.

I have manually tested with Windows 10 in the users import, theme
import, and content import widgets. Styles are preserved (although I
think they could be improved, as the grey outline is really faint) and
uploading now works consistently, instead of mostly triggering display
of the raw file most of the time.
2024-11-22 17:21:00 -06:00
..
.storybook Admin X Design System docs (#19120) 2023-11-23 16:18:59 +01:00
src 🐛 fix Windows bug with the admin file upload widget (#21687) 2024-11-22 17:21:00 -06:00
test 🐛 Fixed navigations links for Ghost sites hosted on a subdirectory (#21071) 2024-09-23 18:37:05 +02:00
.eslintrc.cjs Renamed admin-x-design to admin-x-design-system for clarity (#18914) 2023-11-08 15:10:43 +00:00
.gitignore Renamed admin-x-design to admin-x-design-system for clarity (#18914) 2023-11-08 15:10:43 +00:00
package.json Update dependency react-select to v5.8.2 2024-10-28 00:12:27 +00:00
postcss.config.cjs Created a skeleton AdminX demo app (#19005) 2023-11-20 13:30:15 +00:00
preflight.css Admin X demo app content (#19079) 2023-11-22 13:44:39 +01:00
README.md Renamed admin-x-design to admin-x-design-system for clarity (#18914) 2023-11-08 15:10:43 +00:00
styles.css Custom fonts (#21337) 2024-10-24 07:43:08 -04:00
tailwind.cjs Renamed admin-x-design to admin-x-design-system for clarity (#18914) 2023-11-08 15:10:43 +00:00
tailwind.config.cjs Custom fonts (#21337) 2024-10-24 07:43:08 -04:00
tsconfig.declaration.json Renamed admin-x-design to admin-x-design-system for clarity (#18914) 2023-11-08 15:10:43 +00:00
tsconfig.json Renamed admin-x-design to admin-x-design-system for clarity (#18914) 2023-11-08 15:10:43 +00:00
tsconfig.node.json Renamed admin-x-design to admin-x-design-system for clarity (#18914) 2023-11-08 15:10:43 +00:00
vite.config.ts Hidden "info" Vite output unless in CI 2023-11-15 10:11:22 +01:00

Admin X Design

Components, design guidelines and documentation for building apps in Ghost Admin

Usage

Develop

This is a monorepo package.

Follow the instructions for the top-level repo.

  1. git clone this repo & cd into it as usual
  2. Run yarn to install top-level dependencies.

Test

  • yarn lint run just eslint
  • yarn test run lint and tests