diff --git a/packages/bbui/src/Tabs/Tab.svelte b/packages/bbui/src/Tabs/Tab.svelte
index 0aa59f7f8a..04791619dc 100644
--- a/packages/bbui/src/Tabs/Tab.svelte
+++ b/packages/bbui/src/Tabs/Tab.svelte
@@ -6,7 +6,7 @@
const dispatch = createEventDispatcher()
let selected = getContext("tab")
- let tab
+ let tab_internal
let tabInfo
const setTabInfo = () => {
@@ -16,7 +16,7 @@
// We just need to get this off the main thread to fix this, by using
// a 0ms timeout.
setTimeout(() => {
- tabInfo = tab?.getBoundingClientRect()
+ tabInfo = tab_internal?.getBoundingClientRect()
if (tabInfo && $selected.title === title) {
$selected.info = tabInfo
}
@@ -27,14 +27,30 @@
setTabInfo()
})
+ //Ensure that the underline is in the correct location
+ $: {
+ if ($selected.title === title && tab_internal) {
+ if ($selected.info?.left !== tab_internal.getBoundingClientRect().left) {
+ $selected = {
+ ...$selected,
+ info: tab_internal.getBoundingClientRect(),
+ }
+ }
+ }
+ }
+
const onClick = () => {
- $selected = { ...$selected, title, info: tab.getBoundingClientRect() }
+ $selected = {
+ ...$selected,
+ title,
+ info: tab_internal.getBoundingClientRect(),
+ }
dispatch("click")
}
{lockedBy && !lockedByYou ? "Done" : "Cancel"}
- {#if lockedByYou && lockExpiry > 0}
+ {#if lockedByYou}
@@ -167,6 +182,7 @@
size="M"
cta
icon="Edit"
+ disabled={lockedBy && !lockedByYou}
on:click={() => {
editApp(selectedApp)
}}