[Components] Update compose Picker to expose offset and properties of inner drop down menu#27
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR exposes the inner dropdown’s position and popup properties on PilotPicker and renames the selected-label composable parameter for clarity.
- Added
offset: DpOffsetandproperties: PopupPropertiesparameters to the dropdown - Renamed
itemColorsparameter tolabel(composable for the selected value) - Updated imports to accommodate new defaults and units
Comments suppressed due to low confidence (2)
components/android/material3/src/main/kotlin/com/mirego/pilot/components/ui/material3/PilotPicker.kt:21
- Please update or add KDoc for
PilotPickerto document the newoffsetandpropertiesparameters, explaining their default behavior and usage.
public fun <LABEL : Any, ITEM : Any> PilotPicker(
components/android/material3/src/main/kotlin/com/mirego/pilot/components/ui/material3/PilotPicker.kt:48
- Consider adding or updating unit or UI tests to verify that the exposed
offsetandpropertiesparameters are applied correctly in the dropdown menu.
offset = offset,
| import androidx.compose.material3.DropdownMenu | ||
| import androidx.compose.material3.DropdownMenuItem | ||
| import androidx.compose.material3.MenuDefaults | ||
| import androidx.compose.material3.MenuDefaults.itemColors |
There was a problem hiding this comment.
The static import of MenuDefaults.itemColors is no longer used (you still call MenuDefaults.itemColors()); consider removing this import to clean up unused code.
| import androidx.compose.material3.MenuDefaults.itemColors |
npresseault
left a comment
There was a problem hiding this comment.
Document:
Breaking change: itemColors -> label
npresseault
left a comment
There was a problem hiding this comment.
All good, dont forget to dump new API
I needed to tweak the offset and some properties from the inner DropDownMenu used si I am exposing those fields.
I also renamed itemColors to label since it represent the composable for the label and isn't related to colors at all I think (although that would be a breaking change so I can let it go but the name seemed odd)