fix 'undefined' list item clone bug, hitboxes for recipe icons more comfortable, fix problem where the operation-dropdown would display on click / tap of elements in expanded recipe view ( mobile )

This commit is contained in:
Robin Scholtes 2023-08-14 21:52:26 +12:00
parent 6caaf1dc99
commit 21eb177527
4 changed files with 15 additions and 6 deletions

View file

@ -4,7 +4,5 @@ operations:
manual testing issues manual testing issues
mobile: mobile:
- drag any recipe li will have an ( clone? ) extra li below it with 'undefined' title. Not on desktop - double tap on mobile recipe list sometimes really annoying
- hitboxes combined with drag / mouse events on breakpoint and disable icons kind of sucks - same for grabbing items in rec-list. Especially 'magic' for whatever reason?
- some issues tapping on ingredients causing the op-dropdown to display
- some issues with ingredient breakpoint / disable background colors

View file

@ -34,6 +34,11 @@ export class CIngredientLi extends HTMLElement {
this.addEventListener("dblclick", this.handleDoubleClick.bind(this)); this.addEventListener("dblclick", this.handleDoubleClick.bind(this));
} }
cloneNode() {
const { app, name, args } = this;
return new CIngredientLi( app, name, args );
}
/** /**
* Remove listeners on disconnectedCallback * Remove listeners on disconnectedCallback
*/ */

View file

@ -280,13 +280,19 @@ input.toggle-string {
} }
.recipe-icons i { .recipe-icons i {
margin-right: 10px; height: 30px;
width: 30px;
text-align: center;
vertical-align: baseline; vertical-align: baseline;
float: right; float: right;
font-size: 18px; font-size: 18px;
cursor: pointer; cursor: pointer;
} }
.recipe-icons i:last-child {
margin-right: 10px;
}
.disable-icon { .disable-icon {
color: var(--disable-icon-colour); color: var(--disable-icon-colour);
} }

View file

@ -497,7 +497,7 @@ ${navigator.userAgent}
*/ */
onMaximisedRecipeClick() { onMaximisedRecipeClick() {
// if #recipe is maximised & rec-list is empty on mobile UI // if #recipe is maximised & rec-list is empty on mobile UI
if (this.app.isMobileView() && document.querySelector("#recipe.maximised-pane") && document.querySelectorAll("#rec-list > li").length === 0) { if (this.app.isMobileView() && document.querySelector("#recipe.maximised-pane") && document.querySelectorAll("#rec-list > c-ingredient-li").length === 0) {
// close max pane and display the expanded #operations-dropdown // close max pane and display the expanded #operations-dropdown
this.setPaneMaximised("recipe", false); this.setPaneMaximised("recipe", false);
this.manager.ops.openOpsDropdown(); this.manager.ops.openOpsDropdown();