-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove all instances of optional chaining #489
Changes from 1 commit
6e2e208
4c847f3
ddc08a6
bfcfee2
360e4c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -414,13 +414,14 @@ | |
} | ||
) | ||
const activeMedia = this.querySelector(`[data-media-id="${this.openedBy.getAttribute("data-media-id")}"]`); | ||
const activeMediaContent = activeMedia.querySelector('content'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar comment here to what Chris mentioned on the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@LucasLacerdaUX now that videos and modals are not being used to open the product modal, do we still need this code? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
They are still being used to open the modal, on mobile. I'm not sure if it is also true for featured product, tho. I'll check. But why is this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've tried both, and they didn't seem to make a difference, but I'll check specifically on mobile. It's possible I didn't test on an actual device. I forgot that on mobile, they are are all at as openers for the modal. |
||
activeMedia.classList.add('active'); | ||
activeMedia.scrollIntoView(); | ||
|
||
const container = this.querySelector('[role="document"]'); | ||
container.scrollLeft = (activeMedia.width - container.clientWidth) / 2; | ||
|
||
if (activeMedia.nodeName == 'DEFERRED-MEDIA' && activeMedia.querySelector('template')?.content?.querySelector('.js-youtube')) | ||
if (activeMedia.nodeName == 'DEFERRED-MEDIA' && activeMediaContent && activeMediaContent.querySelector('.js-youtube')) | ||
activeMedia.loadContent(); | ||
} | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -342,8 +342,9 @@ | |
|
||
onItemClick(event) { | ||
event.preventDefault(); | ||
const form = this.querySelector('form'); | ||
this.elements.input.value = event.currentTarget.dataset.value; | ||
this.querySelector('form')?.submit(); | ||
if (form) form.submit(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Couldn't test this part as the country/region and language selectors wouldn't open There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was able to test and it seems to be working on 12.1 for me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created an issue for follow up: #510 |
||
} | ||
|
||
openSelector() { | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -466,14 +466,15 @@ | |||||
} | ||||||
) | ||||||
const activeMedia = this.querySelector(`[data-media-id="${this.openedBy.getAttribute("data-media-id")}"]`); | ||||||
const activeMediaContent = activeMedia.querySelector('content'); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Think there's something off here—I believe it should be updated to
Suggested change
|
||||||
activeMedia.classList.add('active'); | ||||||
activeMedia.scrollIntoView(); | ||||||
|
||||||
const container = this.querySelector('[role="document"]'); | ||||||
container.scrollLeft = (activeMedia.width - container.clientWidth) / 2; | ||||||
container.scrollLeft = (activeMedia.width - container.clientWidth) / 2; | ||||||
martinamarien marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
if (activeMedia.nodeName == 'DEFERRED-MEDIA' && activeMedia.querySelector('template')?.content?.querySelector('.js-youtube')) | ||||||
activeMedia.loadContent(); | ||||||
if (activeMedia.nodeName == 'DEFERRED-MEDIA' && activeMediaContent && activeMediaContent.querySelector('.js-youtube')) | ||||||
activeMedia.loadContent(); | ||||||
martinamarien marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
} | ||||||
} | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get the cart notification to show up 🤔 on Safari 12.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really? I just tested it, and I'm able to get it to work with 12.1.
Screen.Recording.2021-08-26.at.4.44.37.PM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it worked for you then it should be good 👍 I will test again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Ludo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed some of those issues and created a follow up issue here: #510
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 🙏🏻