dash-core-components 4.5.0 → 4.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -177,6 +177,7 @@ pk.Link.propTypes = {children:pt.node,
177
177
  href:pt.string,
178
178
  target:pt.oneOfType([pt.string]),
179
179
  refresh:pt.oneOfType([pt.bool]),
180
+ scrollToTop:pt.oneOfType([pt.bool]),
180
181
  title:pt.oneOfType([pt.string]),
181
182
  className:pt.oneOfType([pt.string]),
182
183
  style:pt.any,
@@ -14,7 +14,11 @@ type LinkComponentProps = LinkProps & {
14
14
  * For links with destinations outside the current app, `html.A` is a better
15
15
  * component to use.
16
16
  */
17
- const Link = ({refresh = false, ...props}: LinkComponentProps) => {
17
+ const Link = ({
18
+ refresh = false,
19
+ scrollToTop = true,
20
+ ...props
21
+ }: LinkComponentProps) => {
18
22
  const {className, style, id, href, children, title, target, setProps} =
19
23
  props;
20
24
  const cleanUrl = window.dash_clientside.clean_url;
@@ -39,8 +43,9 @@ const Link = ({refresh = false, ...props}: LinkComponentProps) => {
39
43
  window.history.pushState({}, '', sanitizedUrl);
40
44
  window.dispatchEvent(new CustomEvent('_dashprivate_pushstate'));
41
45
  }
42
- // scroll back to top
43
- window.scrollTo(0, 0);
46
+ if (scrollToTop) {
47
+ window.scrollTo(0, 0);
48
+ }
44
49
  };
45
50
 
46
51
  useEffect(() => {
@@ -405,6 +405,7 @@ const DatePickerRange = ({
405
405
  disabled={disabled}
406
406
  dir={direction}
407
407
  aria-label={start_date_placeholder_text}
408
+ autoComplete="off"
408
409
  />
409
410
  <ArrowIcon className="dash-datepicker-range-arrow" />
410
411
  <AutosizeInput
@@ -427,6 +428,7 @@ const DatePickerRange = ({
427
428
  disabled={disabled}
428
429
  dir={direction}
429
430
  aria-label={end_date_placeholder_text}
431
+ autoComplete="off"
430
432
  />
431
433
  {clearable && !disabled && (
432
434
  <a
@@ -204,6 +204,7 @@ const DatePickerSingle = ({
204
204
  disabled={disabled}
205
205
  dir={direction}
206
206
  aria-label={placeholder}
207
+ autoComplete="off"
207
208
  />
208
209
  {clearable && !disabled && !!date && (
209
210
  <a
package/lib/types.ts CHANGED
@@ -1514,6 +1514,12 @@ export interface LinkProps {
1514
1514
  */
1515
1515
  refresh?: boolean;
1516
1516
 
1517
+ /**
1518
+ * Controls whether or not the page will scroll to the top when the link is
1519
+ * clicked. Defaults to true.
1520
+ */
1521
+ scrollToTop?: boolean;
1522
+
1517
1523
  /**
1518
1524
  * Adds the title attribute to your link, which can contain supplementary
1519
1525
  * information.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dash-core-components",
3
- "version": "4.5.0",
3
+ "version": "4.5.1",
4
4
  "description": "Core component suite for Dash",
5
5
  "repository": {
6
6
  "type": "git",
@@ -84,10 +84,10 @@
84
84
  "@testing-library/react": "^16.3.2",
85
85
  "@types/d3-format": "^3.0.4",
86
86
  "@types/fast-isnumeric": "^1.1.2",
87
- "@types/hast": "^2.3.10",
87
+ "@types/hast": "^3.0.5",
88
88
  "@types/jest": "^29.5.14",
89
89
  "@types/js-search": "^1.4.4",
90
- "@types/ramda": "^0.31.0",
90
+ "@types/ramda": "^0.32.0",
91
91
  "@types/react": "^18",
92
92
  "@types/react-dom": "^18",
93
93
  "@types/react-input-autosize": "^2.2.4",