tossnet / blazor-color-picker Goto Github PK
View Code? Open in Web Editor NEWOpens a palette with the Material colors for Blazor application
License: GNU General Public License v3.0
Opens a palette with the Material colors for Blazor application
License: GNU General Public License v3.0
Hello,
I updated to .net 5 on my project and version 1.1.1 of the color picker and when I try to initialize a blazor page I get a set focus error on blazor during initiliazation OnAfterRender first render. I think you probably have a JS script somehwere that defines a SetFocus method, and that's conflicting with the blazor js library.
Downgrading to 1.0.9 fixes the problem if anyone else experiences this. I can try to replicate if desired but basically just set up a project with version 1.1.1 through nuget
`EditForm Model="_class" OnSubmit="Submit">
div class="mb-3">
button class="btn btn-primary" @OnClick="OpenModal">
div style="background-color:@color" class="buttonColor"> Select a Color
/button>
ColorPicker Title="@_localizer["Color_pick"]" IsOpened="isOpened" Closed="ClosedEvent" MyColor="@color">/ColorPicker>
/div>
div class="mb-3">
button class="btn btn-primary" type="submit">Save
/div>
/EditForm>
bool isOpened = false;
void OpenModal()
{
isOpened = true;
}
void ClosedEvent(string value)
{
color = value;
isOpened = false;
}`
if i click open modal the submit function is being invoked from edit form :)
In the CSS the class .show
.show {
display: block;
}
I suggest this only need be affect just the control, when we use a boostrap like dropdowns in a table, this class override the behavior
I recently answered a question on this component.
I have used the standard picker in the past, so decided to rework yours as an InputBase
derived input control.
You can see my code here: https://github.com/ShaunCurtis/Blazr.ColorPicker
Hi,
this video shows your code without any copyrights and selling the code.
https://www.youtube.com/watch?v=_slHW2hqZAc
Did you allowed this?
Kind regards
In Azure I've seen several exceptions Uncaught SyntaxError: Unexpected token 'export'
coming from:
lineNumber 1
errorSrc window.onerror@https://foo.com/_content/BlazorColorPicker/colorpicker.js:1:1
url https://foo.com/_content/BlazorColorPicker/colorpicker.js
columnNumber 1
message: Uncaught SyntaxError: Unexpected token 'export'
typeName SyntaxError
when I browse to https://foo.com/_content/BlazorColorPicker/colorpicker.js
I see:
export function SetFocusTo2 (element) {
if (element instanceof HTMLElement) {
element.focus();
}
}
I guess the export
keyword of the function is giving this issue.
.net 7
blazor server
BlazorColorPicker (2.3.0)
Hello,
Is it possible to add a license on this project?
Currently this project falls under no-license, which means:
If you find software that doesn’t have a license, that generally means you have no permission from the creators of the software to use, modify, or share the software. Although a code host such as GitHub may allow you to view and fork the code, this does not imply that you are permitted to use, modify, or share the software for any purpose.
Thx
How did you get this to work in MVC?
I tried your code, but it gives me errors on '@OnClick' and on '@code'.
@using BlazorColorPicker
<button class="btn btn-primary" @OnClick="OpenModal">
@code {
bool isOpened = false;
string color = "#F1F7E9";
void OpenModal()
{
isOpened = true;
}
void ClosedEvent(string value)
{
color = value;
isOpened = false;
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.