[OGUI-1919] Make the copy-to-clipboard component have more flexible styling - #3615
Open
isaachilly wants to merge 19 commits into
Conversation
isaachilly
force-pushed
the
improv/FRM/OGUI-1919/Make-copy-to-clipboard-component-style-flexible
branch
2 times, most recently
from
September 8, 2026 12:31
049167c to
d5f81d6
Compare
isaachilly
force-pushed
the
improv/FRM/OGUI-1919/Make-copy-to-clipboard-component-style-flexible
branch
from
September 9, 2026 06:59
fc6a43c to
286ef4e
Compare
Allow callers to override the button class and pass through inline styles, while keeping the existing primary-button default. The button content wrapper is also centred so the default and copied states stay aligned.
Reset the success timer if clicked again otherwise the button text resets at unpredictable moments and user is left confused if the copy worked or not.
Update `CopyToClipboardComponent` to accept a `classes` suffix instead of a full `className` selector, and build the button selector from a consistent `button.btn` base.
Documented expected `vnode.attrs` fields in `CopyToClipboardComponent.view()` and added `ariaLive: 'polite'` to the status content container so copy success feedback is announced to assistive technologies.
Wrap clipboard writes in error handling and add an optional `onFailure` callback so callers can react when copying is unavailable or fails. The component also now destructures `style` explicitly.
Done so clipboard write failures are properly caught by the existing error handling path, instead of proceeding as if copy succeeded.
On second thought if no other elements have it, I won't add here and wait for a proper strategy.
Initialise clipboard support state once in constructor and reuse it during rendering. This removes repeated availability checks on each render and drives button disabled/title directly from persisted fields.
isaachilly
force-pushed
the
improv/FRM/OGUI-1919/Make-copy-to-clipboard-component-style-flexible
branch
from
September 11, 2026 13:31
31109a6 to
38ac42a
Compare
isaachilly
marked this pull request as ready for review
September 11, 2026 14:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have JIRA issue created
Ticket:
Make the component more flexible, especially with regards to styling as used to always be
btn-primarystyle and to improve the component enough that it can be used in ILG share button.Code:
onFailurehandlernullif there is no messageidattribute when none is passedReviewer:
To test
onFailiurelogic edit a use of the component and in console setwriteTextto raise an Error.