File tree 3 files changed +15
-14
lines changed
packages/react-error-overlay/src
3 files changed +15
-14
lines changed Original file line number Diff line number Diff line change 1
1
/* @flow */
2
2
import { applyStyles } from '../utils/dom/css' ;
3
- import { groupStyle , groupElemLeft , groupElemRight } from '../styles' ;
3
+ import {
4
+ additionalChildStyle ,
5
+ groupStyle ,
6
+ groupElemLeft ,
7
+ groupElemRight ,
8
+ } from '../styles' ;
4
9
import { consumeEvent } from '../utils/dom/consumeEvent' ;
5
10
import { enableTabClick } from '../utils/dom/enableTabClick' ;
6
11
@@ -20,7 +25,9 @@ function updateAdditional(
20
25
return ;
21
26
}
22
27
23
- const span = document . createElement ( 'span' ) ;
28
+ const div = document . createElement ( 'div' ) ;
29
+ applyStyles ( div , additionalChildStyle ) ;
30
+
24
31
const group = document . createElement ( 'span' ) ;
25
32
applyStyles ( group , groupStyle ) ;
26
33
@@ -44,12 +51,12 @@ function updateAdditional(
44
51
45
52
group . appendChild ( left ) ;
46
53
group . appendChild ( right ) ;
47
- span . appendChild ( group ) ;
54
+ div . appendChild ( group ) ;
48
55
49
56
const text = `${ currentError } of ${ totalErrors } errors on the page` ;
50
- span . appendChild ( document . createTextNode ( text ) ) ;
57
+ div . appendChild ( document . createTextNode ( text ) ) ;
51
58
52
- additionalReference . appendChild ( span ) ;
59
+ additionalReference . appendChild ( div ) ;
53
60
}
54
61
55
62
export type { SwitchCallback } ;
Original file line number Diff line number Diff line change 1
1
/* @flow */
2
2
import { applyStyles } from '../utils/dom/css' ;
3
- import {
4
- containerStyle ,
5
- overlayStyle ,
6
- headerStyle ,
7
- additionalStyle ,
8
- } from '../styles' ;
3
+ import { containerStyle , overlayStyle , headerStyle } from '../styles' ;
9
4
import { createClose } from './close' ;
10
5
import { createFrames } from './frames' ;
11
6
import { createFooter } from './footer' ;
@@ -42,7 +37,6 @@ function createOverlay(
42
37
43
38
// Create "Errors X of Y" in case of multiple errors
44
39
const additional = document . createElement ( 'div' ) ;
45
- applyStyles ( additional , additionalStyle ) ;
46
40
updateAdditional (
47
41
document ,
48
42
additional ,
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ const closeButtonStyle = {
64
64
top : 0 ,
65
65
} ;
66
66
67
- const additionalStyle = {
67
+ const additionalChildStyle = {
68
68
'margin-bottom' : '0.5rem' ,
69
69
} ;
70
70
@@ -197,7 +197,7 @@ export {
197
197
hintsStyle ,
198
198
hintStyle ,
199
199
closeButtonStyle ,
200
- additionalStyle ,
200
+ additionalChildStyle ,
201
201
headerStyle ,
202
202
functionNameStyle ,
203
203
linkStyle ,
You can’t perform that action at this time.
0 commit comments