Skip to content

Commit

Permalink
Merge branch 'master' into fix-zIndex-via-props
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSGJ authored Oct 16, 2023
2 parents f72c954 + 5854c1f commit c2d04a2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nextjs-toploader",
"version": "1.4.2",
"version": "1.4.3",
"description": "A Next.js Top Loading Bar component made using nprogress, works with Next.js 13.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
8 changes: 5 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export type NextTopLoaderProps = {
shadow?: string | false;
/**
* Defines zIndex for the TopLoader.
* @default 1031
* @default 1600
*
*/
zIndex?: number;
Expand All @@ -78,7 +78,7 @@ const NextTopLoader = ({
easing,
speed,
shadow,
zIndex = 1031,
zIndex = 1600,
}: NextTopLoaderProps) => {
const defaultColor = '#29d';
const defaultHeight = 3;
Expand Down Expand Up @@ -145,8 +145,10 @@ const NextTopLoader = ({
const currentUrl = window.location.href;
const newUrl = (anchor as HTMLAnchorElement).href;
const isExternalLink = (anchor as HTMLAnchorElement).target === '_blank';
const isBlob = newUrl.startsWith('blob:');
const isAnchor = isAnchorOfCurrentUrl(currentUrl, newUrl);
if (newUrl === currentUrl || isAnchor || isExternalLink) {

if (newUrl === currentUrl || isAnchor || isExternalLink || isBlob) {
NProgress.start();
NProgress.done();
[].forEach.call(npgclass, function (el: Element) {
Expand Down
2 changes: 1 addition & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Options } from 'tsup';
export const tsup: Options = {
target: 'esnext',
target: 'es6',
clean: true,
dts: true,
entry: ['src/index.tsx'],
Expand Down

0 comments on commit c2d04a2

Please sign in to comment.