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

HTML5 color selector broken on WebKit browsers #535

Open
kanflo opened this issue Oct 26, 2024 · 0 comments
Open

HTML5 color selector broken on WebKit browsers #535

kanflo opened this issue Oct 26, 2024 · 0 comments

Comments

@kanflo
Copy link

kanflo commented Oct 26, 2024

WebKit browsers (macOS, iOS) send onchange for every change in color selection (including eg. sliding of RGB bars). This causes remi to send an update to the color widget, eg:

<input id="133167224621328" class="color" value="#beff4c" type="color" autocomplete="off" onchange="var params{};params['value']=document.getElementById('133167224621328').value;remi.sendCallbackParam('133167224621328','onchange',params);" data-parent-widget="133167224323712" style="margin:10px;width:30px;height:30px;position:static;order:-1"></input>

which in turn closes the color selector (and interrupts color selection). Chromium browsers on the other hand do not send onchange until the user closes the color picker. I did a workaround in send_message(...):

    if 'class="color"' in from_websocket(message):
        self._log.warning("ignoring message that would close the color picker on iOS")
        return True

A better solution would be to skip the message earlier, possibly based on the client browser.

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

No branches or pull requests

1 participant