fix(shops): hide popover on mobile to prevent purchase blocking (#10917)#15606
Open
ttpss930141011 wants to merge 1 commit intoHabitRPG:developfrom
Open
fix(shops): hide popover on mobile to prevent purchase blocking (#10917)#15606ttpss930141011 wants to merge 1 commit intoHabitRPG:developfrom
ttpss930141011 wants to merge 1 commit intoHabitRPG:developfrom
Conversation
4a4ab5c to
4ae8e31
Compare
…tRPG#10917) On mobile browsers, the shop item popover triggers on touch and covers the item, preventing users from clicking to purchase pinned items. This fix: - Adds isMobile data property checking window.innerWidth < 768 - Adds shouldShowPopover computed that disables popover on mobile - Adds resize listener to handle device rotation Closes HabitRPG#10917
4ae8e31 to
c967cb0
Compare
2d54f93 to
d465efa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10917
Changes
On mobile browsers (<768px), the shop item popover (triggered by
hover focusin Bootstrap-Vueb-popover) activates on touch and covers the item card, preventing users from tapping to purchase pinned items. Since the popover cannot be easily dismissed on touch devices, it effectively blocks interaction with the shop.This fix adds a mobile check to conditionally disable the popover on small screens:
isMobiledata property — checkswindow.innerWidth < 768on mountshouldShowPopovercomputed — returnsshowPopover && !isMobile, replacing the originalv-if="showPopover"on the<b-popover>componenthandleResizemethod +resizeevent listener — updatesisMobileon viewport changes (e.g., device rotation)On desktop, popover behavior is unchanged. On mobile, users tap items to open the purchase modal directly without the popover blocking the UI.
Screenshots
Desktop — popover works normally on hover:
Mobile BUG (before fix) — popover covers UI on touch, blocking interaction:
Mobile FIXED (after fix) — no popover, clean UI:
File changed:
website/client/src/components/shops/shopItem.vue(+10 lines)UUID: 854d383c-ce47-4659-96b6-e4603aadd69e