Use library defaults for settings

Created on 4 August 2023, over 1 year ago
Updated 7 August 2023, over 1 year ago

Problem/Motivation

I was wondering, why the background was 100% black, in contrast to the examples at https://photoswipe.com/

The reason is, that (I guess even since 4.x) wrong defaults are used for the settings defaults in the config.

These are the default options from the code:
https://github.com/dimsemenov/PhotoSwipe/blob/31c8a855170fc747db08445cb0...

const defaultOptions = {
  allowPanToNext: true,
  spacing: 0.1,
  loop: true,
  pinchToClose: true,
  closeOnVerticalDrag: true,
  hideAnimationDuration: 333,
  showAnimationDuration: 333,
  zoomAnimationDuration: 333,
  escKey: true,
  arrowKeys: true,
  returnFocus: true,
  maxWidthToAnimate: 4000,
  clickToCloseNonZoomable: true,
  imageClickAction: 'zoom-or-close',
  bgClickAction: 'close',
  tapAction: 'toggle-controls',
  doubleTapAction: 'zoom',
  indexIndicatorSep: ' / ',
  preloaderDelay: 2000,
  bgOpacity: 0.8,

  index: 0,
  errorMsg: 'The image cannot be loaded',
  preload: [1, 2],
  easing: 'cubic-bezier(.4,0,.22,1)'
};

Steps to reproduce

Compare the values from the config defaults to https://photoswipe.com/options/

Proposed resolution

Adjust the config defaults to the defaults from https://photoswipe.com/options/ and leave existing projects untouched.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

5.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024