Skip to content

Update sync split-button example with changes in Explainer doc#125

Merged
gregwhitworth merged 6 commits intoopenui:componentsfrom
dandclark:dandclark/components
Jul 14, 2020
Merged

Update sync split-button example with changes in Explainer doc#125
gregwhitworth merged 6 commits intoopenui:componentsfrom
dandclark:dandclark/components

Conversation

@dandclark
Copy link
Collaborator

@dandclark dandclark commented Jul 10, 2020

Update select implementation so that the controller code is applied to the button and listbox parts directly, rather than using the <slot>s.

Refactor so that the same code adds controller functionality to both the default parts and to the user-replaced parts, which should make it easier to keep these in-sync.

In the split-button example:

  • Remove the preventDefault that was keeping mouse clicks from working on the left half of the button, and achieve this functionality instead by moving `part='button' to the arrow element.
  • Add slot/part to listbox.
  • Fix typo in CSS class.

…art. With this change, the split-button no longer needs to preventDefault to make only the arrow section of the button open the listbox.
…ighted instead of watching for checked. This way there's a visual indicator when using up/down arrows to select a value.
…istbox part. Refactor so that the same functions are used to apply controller code to both the default parts and the user-supplied parts, to ensure that these remain consistent.
Copy link
Member

@gregwhitworth gregwhitworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the changes to the controller code. You'll need to put the part='button' back onto the button-container or come up with another solution for it to match the bootstrap example (I linked to it in the code).

@gregwhitworth gregwhitworth merged commit 7c82a29 into openui:components Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants