Skip to content

Commit

Permalink
fix(js): calculate panel position before opening (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour authored Nov 24, 2020
1 parent 9a897e9 commit 307a7ac
Show file tree
Hide file tree
Showing 11 changed files with 594 additions and 10 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module.exports = {
extends: ['algolia', 'algolia/jest', 'algolia/react', 'algolia/typescript'],
globals: {
__DEV__: false,
__TEST__: false,
},
settings: {
react: {
Expand Down
4 changes: 4 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ module.exports = (api) => {
type: 'node',
replacement: "process.env.NODE_ENV !== 'production'",
},
__TEST__: {
type: 'node',
replacement: "process.env.NODE_ENV === 'test'",
},
},
],
]),
Expand Down
1 change: 1 addition & 0 deletions examples/js/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
// We therefore need to manually override it in the example app.
// See https://twitter.com/devongovett/status/1134231234605830144
(global as any).__DEV__ = process.env.NODE_ENV !== 'production';
(global as any).__TEST__ = false;
1 change: 1 addition & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
declare const __DEV__: boolean;
declare const __TEST__: boolean;
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ module.exports = {
],
globals: {
__DEV__: true,
__TEST__: true,
},
};
1 change: 1 addition & 0 deletions packages/autocomplete-js/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare const __TEST__: boolean;
Loading

0 comments on commit 307a7ac

Please sign in to comment.