mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Disable view-source button rather than hiding it to avoid jumping when selecting new components
This commit is contained in:
1 parent
1e4434ecc4
commit
05ef0ad7dc
1 file changed
+8
-9
@@ -81,15 +81,14 @@ export default function SelectedElement(_: Props) {
|
||||
>
|
||||
<ButtonIcon type="view-dom" />
|
||||
</Button>
|
||||
{canViewSource && (
|
||||
<Button
|
||||
className={styles.IconButton}
|
||||
onClick={viewSource}
|
||||
title="View source for this element"
|
||||
>
|
||||
<ButtonIcon type="view-source" />
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
className={styles.IconButton}
|
||||
disabled={!canViewSource}
|
||||
onClick={viewSource}
|
||||
title="View source for this element"
|
||||
>
|
||||
<ButtonIcon type="view-source" />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{inspectedElement === null && (
|
||||
|
||||
Reference in new issue
Block a user