forked from Furumi/furumi-web
fix: keep expanded search aligned during header updates
This commit is contained in:
1 parent
54c02dc806
commit
297b01dd0a
2 files changed
+8
-2
No files matched your search
@@ -322,7 +322,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="search-bar"
|
||||
x-data="{ expanded:false, left:0, right:0, measure() { const bar=$el.getBoundingClientRect(); const panel=$el.closest('.content-topbar').getBoundingClientRect(); this.left=Math.max(0,bar.left-panel.left); this.right=Math.max(0,panel.right-bar.right); } }"
|
||||
x-data="{ expanded:false, left:0, right:0, observer:null, init() { this.observer=new ResizeObserver(()=>this.measure()); this.observer.observe($el); }, destroy() { this.observer?.disconnect(); }, measure() { const bar=$el.getBoundingClientRect(); const panel=$el.closest('.content-topbar').getBoundingClientRect(); this.left=Math.max(0,bar.left-panel.left); this.right=Math.max(0,panel.right-bar.right); } }"
|
||||
:class="{ 'search-expanded':expanded }"
|
||||
:style="{ '--search-expand-left':left+'px', '--search-expand-right':right+'px' }"
|
||||
@focusin="measure(); expanded=true; $store.user.menuOpen=false"
|
||||
|
||||
Reference in new issue
Block a user