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
Adding basic ordering to tab slot fill #38081
Changes from 4 commits
95c05e0
2c17cd2
ee08a26
b36dddf
a082ef4
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: add | ||
|
||
Adding basic ordering to product tabs slot-fill. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,9 @@ | |
}, | ||
"title": { | ||
"type": "string" | ||
}, | ||
"order": { | ||
"type": "number" | ||
} | ||
}, | ||
"supports": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: add | ||
|
||
Adding order attributes to product tabs template. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -371,6 +371,7 @@ public static function register_post_types() { | |
array( | ||
'id' => 'general', | ||
'title' => __( 'General', 'woocommerce' ), | ||
'order' => 10, | ||
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. Just noting that I think this is a good short-term fix, but long-term I'd love to see this Do we have another issue already to track this long-term and provide a fix for the underlying cause? 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. @joshuatf Originally I believe both @louwie17 and I were considering this a potential future extensibility point, in which case you'd want a way to control the order by using the slot-fill directly. Now that you mention it, though, that wouldn't ultimately make sense since you'd need to use the block extensibility hooks to relay the inner blocks anyways. If we're considering this exclusive to internal use then I'd agree that the usage of 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. It actually looks like this may have just been resolved upstream. Edit: I made a note of this in the future concerns doc. 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. Thanks for updating the future concerns doc, we should check if that does solve our problem, maybe when Gutenberg 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 just tested this with the latest GB trunk version and it does seem to be fixed now 🎉 |
||
), | ||
array( | ||
array( | ||
|
@@ -491,6 +492,7 @@ public static function register_post_types() { | |
array( | ||
'id' => 'pricing', | ||
'title' => __( 'Pricing', 'woocommerce' ), | ||
'order' => 20, | ||
), | ||
array( | ||
array( | ||
|
@@ -614,6 +616,7 @@ public static function register_post_types() { | |
array( | ||
'id' => 'inventory', | ||
'title' => __( 'Inventory', 'woocommerce' ), | ||
'order' => 30, | ||
), | ||
array( | ||
array( | ||
|
@@ -763,6 +766,7 @@ public static function register_post_types() { | |
array( | ||
'id' => 'shipping', | ||
'title' => __( 'Shipping', 'woocommerce' ), | ||
'order' => 40, | ||
), | ||
array( | ||
array( | ||
|
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.
Any reason we removed the scroll to top on navigation? I'm no longer being scrolled to the top when navigating to a new tab.
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 removed this line since I noticed that the
navigateTo()
utility actually includes that line as well, so it was redundant. On looking at this further I'm realizing that it wasn't working to begin with. This is due to the fact that the form scrolling is actually from theoverflow: auto
on the interface-skeleton body, and not the document.This is actually all seeming a bit odd, as the way it's setup the global sidebar is actually not fixed, but the interface skeleton container is. It's then creating a scrollable body container where our form lives. This could be changed to make the sidebar fixed (as it is with the previous react and legacy editors), but that would be diverging from the blocks way, I suppose. It's also creating the dual scrollbars on the right-hand side of the screen:
We may want to decide first if we want to considering changing anything on a larger scale here to address both of those issues, or work around them. We can't simply use a
getScrollContainer()
from@wordpress/dom
here since it's in a slot-fill, but there are other ways to work around it of course.Perhaps a follow-up then?