Extends Select2 v4 plugin by adding an option to disable the title attribute from the selected elements.
The plugin attaches a title
attribute to the selected elements by default, and there is no configuration option available to disable this behavior.
The problem can be reproduced in by placing the mouse over the select box (in single selection mode) or over the selected tags (in multiple selection mode):
Include the script after Select2 main javascript file:
<script src="select2.js"></script>
<script src="select2-selectionTitleAttribute.js"></script>
The selectionTitleAttribute
is a boolean option and it defaults to true
(which means that the title attribute will be showed).
Initialize the select2 plugin with the selectionTitleAttribute
option set to false
:
$("select").select2({
// other options
selectionTitleAttribute: false
});
Demo available on JsFiddle.