Code Monkey home page Code Monkey logo

Comments (7)

dhp-denero avatar dhp-denero commented on June 8, 2024

Hi,

I am also facing same issue as James.

Can anyone guide me to fix it ?

from bootstrap-iconpicker.

dhp-denero avatar dhp-denero commented on June 8, 2024

Hello James,

I looked inside the code and find the root cause of the issue. it will close the icon picker popup on selection or click on body part.

You can fix it by override close event of bootstrap dialog.
close: function () {
$('.iconpicker').each(function () {
if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {
$(this).popover('destroy');
}
});
this._super.apply(this, arguments);
}

from bootstrap-iconpicker.

mpsq avatar mpsq commented on June 8, 2024

It seems to be related to the pull request that I created:
#20
Do you have the same bug if you specify the dialog as the iconpicker container?

from bootstrap-iconpicker.

dhp-denero avatar dhp-denero commented on June 8, 2024

Yes

I have same issue.

from bootstrap-iconpicker.

victor-valencia avatar victor-valencia commented on June 8, 2024

Maybe you can solve using the div tag instead of the button label.

In the latest version, this feature is included.

  • v1.7.0.
    • Support for button and div tags.
    • All iconset includes the empty icon value.
    • Option rows accepts the value 0 to indicate all rows.
    • Add options:
      • align
      • header
      • footer
    • Add methods:
      • setAlign
      • setHeader
      • setFooter
    • Support for 1 more icon fonts:

from bootstrap-iconpicker.

jamesjenner avatar jamesjenner commented on June 8, 2024

@victor-valencia
I'm not sure how using the div tag instead of button label will resolve the issue, as I need the selection of an icon to be via a popup, not a panel within an existing panel.

@merildev
Not the same problem sorry.

@dhp-denero
Thank you for the tip. Not exactly what I needed but I didn't realise I could call destroy, so using your code I managed to write the following:

onEscape: function () {
  $('#selectPanelIcon').each(function () {
    $(this).popover('destroy');
  });

  return true;
},

This works perfectly with bootstrap-iconpicker, which is what I was using. I found that the above doesn't cause any exceptions, even if there is no active popover.

However I would suggest that the API for iconpicker include an option to allow open/close of the icon selection popup, maybe something along the lines of the following:

$('#target').iconpicker('openPicker');
$('#target').iconpicker('closePicker');

from bootstrap-iconpicker.

vseryakov avatar vseryakov commented on June 8, 2024

Here is my solution, i just made the button toggle, in version 1.7.0 line 466:

$this.off("click").on('click', function(e) {
e.preventDefault();
if (!$this.data('bs.popover')) {
$this.popover({
animation: false,
trigger: 'manual',
html: true,
content: op.table,
container: 'body',
placement: op.placement
}).on('shown.bs.popover', function () {
data.switchPage(op.icon);
data.bindEvents();
});
$this.data('bs.popover').tip().addClass('iconpicker-popover');
$this.popover('show');
} else {
$this.popover('destroy');
}
});

from bootstrap-iconpicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.