@samitouri / QOS-React-2 / commits / 05ef0ad7dc

Disable view-source button rather than hiding it to avoid jumping when selecting new components

Brian Vaughn committed Feb 27, 2019 at 13:30 UTC 05ef0ad7dc8d1dc7cfb8b3a66a49f5457f0f670c
1 file changed +8 -9
src/devtools/views/SelectedElement.js
+8 -9
@@ -81,15 +81,14 @@ export default function SelectedElement(_: Props) {
81 >
82 <ButtonIcon type="view-dom" />
83 </Button>
84 - {canViewSource && (
85 - <Button
86 - className={styles.IconButton}
87 - onClick={viewSource}
88 - title="View source for this element"
89 - >
90 - <ButtonIcon type="view-source" />
91 - </Button>
92 - )}
84 + <Button
85 + className={styles.IconButton}
86 + disabled={!canViewSource}
87 + onClick={viewSource}
88 + title="View source for this element"
89 + >
90 + <ButtonIcon type="view-source" />
91 + </Button>
92 </div>
93
94 {inspectedElement === null && (