Skip to content
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

Expose toggle method for the snackbar component #326

Closed
IvayloG opened this issue Apr 12, 2022 · 0 comments · Fixed by #330
Closed

Expose toggle method for the snackbar component #326

IvayloG opened this issue Apr 12, 2022 · 0 comments · Fixed by #330

Comments

@IvayloG
Copy link

IvayloG commented Apr 12, 2022

Description

By design, the snackbar exposes only Show&Hide methods.
Having a slim API is nice for maintenance however, missing Toggle method results in both:

  1. Unconsistend API through the frameworks as it is exposed in igniteui-angular
  2. From AB/CodeGen perspective: Can't reuse the existing toggle functionality and simply use the same target(button) to generate a toggle functionality.

Steps to reproduce

  1. Open AB
  2. Add a button and a snackbar.
  3. Set OnClick for the button and the snackbar as a target.
  4. Observe both click handlers

Result

For both toggle scenarios(snackbar OR a button as origin), the following could not be achieved as Toggle() is not yet implemented.

Blazor*
	<IgbButton @onclick="@(e => Snackbar?.Toggle())" @ref="Snackbar">Button</IgbButton>
	<IgbSnackbar Action="e => Snackbar?.Toggle()" @ref="Snackbar">Message</IgbSnackbar>

@code {
    private IgbSnackbar Snackbar;
}

Expected result

  • Having a toggle method exposed, the above pseudo-code will actually work.

  • Having in mind Snackbar toggling itself could be argued as it could only be closed and not open by itself, triggering toggle from outside (ex. a button) is a pretty main scenario.

@IvayloG IvayloG added 🆕 status: new The issue is new and will be reviewed when somebody picks it up. feature-request snackbar labels Apr 12, 2022
@rkaraivanov rkaraivanov added ✅ status: resolved and removed 🆕 status: new The issue is new and will be reviewed when somebody picks it up. labels Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants