fix(ui): disable scrolling when dropdown is open
This commit is contained in:
@@ -55,15 +55,14 @@ export const GameDropdown: React.FC<GameDropdownProps> = ({
|
|||||||
// Use mousedown to catch clicks before they might trigger other things
|
// Use mousedown to catch clicks before they might trigger other things
|
||||||
document.addEventListener('mousedown', handleClickOutside);
|
document.addEventListener('mousedown', handleClickOutside);
|
||||||
|
|
||||||
// Handle scroll to update position or close?
|
// Disable scrolling while dropdown is open
|
||||||
const handleScroll = () => {
|
const originalOverflow = document.body.style.overflow;
|
||||||
// Optional: onClose();
|
document.body.style.overflow = 'hidden';
|
||||||
};
|
|
||||||
window.addEventListener('scroll', handleScroll, true);
|
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
document.removeEventListener('mousedown', handleClickOutside);
|
document.removeEventListener('mousedown', handleClickOutside);
|
||||||
window.removeEventListener('scroll', handleScroll, true);
|
// Restore scrolling
|
||||||
|
document.body.style.overflow = originalOverflow;
|
||||||
};
|
};
|
||||||
}, [isOpen, onClose]);
|
}, [isOpen, onClose]);
|
||||||
|
|
||||||
|
|||||||
@@ -9,25 +9,28 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Padded Image for enemies */
|
/* Padded Image for enemies */
|
||||||
/* Padded Image for enemies - Matches item card structure but with padding */
|
.grid-card .entity-image.padded-image {
|
||||||
.padded-image {
|
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
box-sizing: border-box;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.padded-image img {
|
.grid-card .entity-image.padded-image img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: contain !important;
|
object-fit: cover !important;
|
||||||
/* Ensure enemies don't get cropped */
|
/* Crop to 1:1 as requested */
|
||||||
|
display: block;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Remove old expanded grid styles */
|
/* Remove old expanded grid styles */
|
||||||
.corpse-container {
|
.corpse-container {
|
||||||
display: contents;
|
display: contents;
|
||||||
|
|||||||
Reference in New Issue
Block a user