Fix spotlight tile regressions
The buttons were scrolling with the view instead of always being visible in a fixed location on the tile, and the indicators were not adopting the correct width.
This commit is contained in:
@@ -14,7 +14,9 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.tile {
|
.contents {
|
||||||
|
block-size: 100%;
|
||||||
|
inline-size: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
border-radius: var(--cpd-space-6x);
|
border-radius: var(--cpd-space-6x);
|
||||||
contain: strict;
|
contain: strict;
|
||||||
@@ -29,7 +31,7 @@ limitations under the License.
|
|||||||
scroll-behavior: smooth; */
|
scroll-behavior: smooth; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.tile.maximised {
|
.tile.maximised .contents {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,7 +155,7 @@ limitations under the License.
|
|||||||
}
|
}
|
||||||
|
|
||||||
.indicators > .item {
|
.indicators > .item {
|
||||||
inline-size: 32px;
|
flex-basis: 32px;
|
||||||
block-size: 2px;
|
block-size: 2px;
|
||||||
transition: background-color ease 0.15s;
|
transition: background-color ease 0.15s;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -272,6 +272,7 @@ export const SpotlightTile = forwardRef<HTMLDivElement, Props>(
|
|||||||
<ChevronLeftIcon aria-hidden width={24} height={24} />
|
<ChevronLeftIcon aria-hidden width={24} height={24} />
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
<div className={styles.contents}>
|
||||||
{vms.map((vm) => (
|
{vms.map((vm) => (
|
||||||
<SpotlightItem
|
<SpotlightItem
|
||||||
key={vm.id}
|
key={vm.id}
|
||||||
@@ -282,6 +283,7 @@ export const SpotlightTile = forwardRef<HTMLDivElement, Props>(
|
|||||||
snap={scrollToId === null || scrollToId === vm.id}
|
snap={scrollToId === null || scrollToId === vm.id}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
</div>
|
||||||
{onToggleExpanded && (
|
{onToggleExpanded && (
|
||||||
<button
|
<button
|
||||||
className={classNames(styles.expand)}
|
className={classNames(styles.expand)}
|
||||||
@@ -311,7 +313,11 @@ export const SpotlightTile = forwardRef<HTMLDivElement, Props>(
|
|||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{vms.map((vm) => (
|
{vms.map((vm) => (
|
||||||
<div className={styles.item} data-visible={vm.id === visibleId} />
|
<div
|
||||||
|
key={vm.id}
|
||||||
|
className={styles.item}
|
||||||
|
data-visible={vm.id === visibleId}
|
||||||
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user