Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Colorpicker closing after selecting a color, when another picker is open #310

Open
Josh-Nicholson opened this issue Mar 19, 2020 · 5 comments

Comments

@Josh-Nicholson
Copy link

Description

Colorpicker closes on any click when you have navigated/clicked from another open colorpicker

Context

  • bootstrap-colorpicker version: 3.1.2
  • bootstrap version: 4.2.1
  • jQuery version: 3.4.1
  • Browser name and version: Chrome 80.0.3987.149
  • Operative System name an version: Windows 10

Expected behavior

  1. Have two colorpickers created on the page, but not shown
  2. Open one of them and select a color
  3. Whilst still having the first one open, click the element that will show the second colorpicker. The first colorpicker will now close and the second one will open.
  4. Click anywhere on the second colorpicker and remains open, and can still be interacted with

Actual behavior

  1. Have two colorpickers created on the page, but not shown
  2. Open one of them and select a color
  3. Whilst still having the first one open, click the element that will show the second colorpicker. The first colorpicker will now close and the second one will open.
  4. Click anywhere on the second colorpicker and it will close (unexcepted behaviour, it should stay open)

It should only close when the user has clicked outside of the second colorpicker.
It works correctly if you click outside of the first colorpicker anywhere on the page where another colorpicker won't be shown.

Live Example

Couldn't get jsfiddle to work with the links provided for a template.
Just create two input which each have a colorpicker.
Click on one to get the corresponding colorpicker to open.
Then click on the other input whilst the first colorpicker is still shown.
Then click anywhere on the second colorpicker and it will close

@itsjavi
Copy link
Owner

itsjavi commented Mar 31, 2020

This is expected behavior. The same happens with browser's HTML select elements (combobox): If you use one, the other is collapsed.

@itsjavi itsjavi closed this as completed Mar 31, 2020
@itsjavi itsjavi added the won't fix The issue won't be fixed because of unsupported browsers or out of the scope of the project goals. label Mar 31, 2020
@Josh-Nicholson
Copy link
Author

Sorry thats not what I was getting at.

Let me try to explain it again.

Given two dialogue boxes that each open separate colourpicker instances, clicking one dialogue box and choosing a colour, then immediately clicking into the other dialogue box, closes the first colourpicker instance (expected behaviour) and then opens and immediately closes the second colourpicker instance before allowing you to choose a colour (unexpected behaviour).

This is a bug.

I can try and record whats happening if you are still unsure.

@macduy
Copy link

macduy commented Feb 13, 2021

@itsjavi This is reproducible on the demo page as well: https://itsjavi.com/bootstrap-colorpicker/tutorial-Basics.html

Repro steps;

  1. Click on a colorpicker
  2. Click on another colorpicker

As you say it's expected is that the first color picker is closed. All good here.

However, what's not expected is that as soon as you interact with the new colorpicker, it closes immediately after that interaction. The expected behaviour is for it to stay open.

Note that this does not happen when popover.animated = false, however turning off animation causes other problems, like colorpicker not opening after it has been closed.

It's possible it might be a bug in popover, any thoughts on potential causes are welcome.

Thanks!

@macduy
Copy link

macduy commented Feb 13, 2021

For your convenience, I've recorded the bug here: https://drive.google.com/file/d/1hbuxS7TpPK17wjwO-WYEjW-g0x5Mac0Z/view

@itsjavi itsjavi reopened this Feb 15, 2021
@itsjavi itsjavi changed the title Colorpicker closing when should remain open Colorpicker closing after selecting a color, when another picker is open Feb 15, 2021
@itsjavi
Copy link
Owner

itsjavi commented Feb 15, 2021

Thanks for the example, it's clearer now. I will reopen the issue. @macduy

@itsjavi itsjavi added bug and removed won't fix The issue won't be fixed because of unsupported browsers or out of the scope of the project goals. labels Feb 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants