Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export function init(id, invoke, value, changedEventCallback) {
const handlerKeydown = (ac, e) => {
const key = e.key;
const { el, invoke, menu } = ac;
if (key === 'Enter' || key === 'NumpadEnter') {
if (key === 'Enter') {
const skipEnter = el.getAttribute('data-bb-skip-enter') === 'true';
if (!skipEnter) {
const current = menu.querySelector('.active');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export function init(id, invoke, closeCallback) {
}
confirm.hide = () => {
const popover = getDescribedElement(el)
if (popover == null) {
return;
}

popover.classList.remove('show')

const children = popover.children
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function handleKeyUp(id, invoke, enter, enterCallbackMethod, esc, escCall
const el = document.getElementById(id)
if (el) {
EventHandler.on(el, 'keyup', e => {
if (enter && (e.key === 'Enter' || e.key === 'NumpadEnter')) {
if (enter && (e.key === 'Enter')) {
const useShiftEnter = el.getAttribute('data-bb-shift-enter') === 'true';
if (!e.shiftKey && useShiftEnter) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/BootstrapBlazor/Components/IpAddress/IpAddress.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ export function init(id) {
selectCell(el, index - 1)
}
}
else if (current.selectionStart === current.value.length && (e.code === 'Space' || e.code === 'ArrowRight')) {
else if (current.selectionStart === current.value.length && (e.key === 'Space' || e.key === 'ArrowRight')) {
e.preventDefault()
selectCell(el, index + 1)
}
else if (current.selectionStart === 0 && e.code === 'ArrowLeft') {
else if (current.selectionStart === 0 && e.key === 'ArrowLeft') {
e.preventDefault()
selectCell(el, index - 1)
}
Expand Down
4 changes: 2 additions & 2 deletions src/BootstrapBlazor/Components/Select/MultiSelect.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ export function init(id, invoke, options) {
const triggerSpace = e.target.getAttribute('data-bb-trigger-key') === 'space';
let submit = false;
if (triggerSpace) {
if (e.code === 'Space') {
if (e.key === 'Space') {
submit = true;
}
}
else if (e.code === 'Enter' || e.code === 'NumPadEnter') {
else if (e.key === 'Enter') {
submit = true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/Components/Textarea/Textarea.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function init(id) {

Data.set(id, text);
EventHandler.on(el, 'keydown', e => {
if (e.key === "Enter" || e.key === "NumpadEnter") {
if (e.key === "Enter") {
const useShiftEnter = el.getAttribute('data-bb-shift-enter') === 'true';
const shiftKey = e.shiftKey;
if (useShiftEnter && shiftKey === false) {
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/wwwroot/modules/base-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const initKeydownHandler = select => {
const keydown = e => {
const menu = popover.toggleMenu;
const key = e.key;
if (key === "Enter" || key === 'NumpadEnter') {
if (key === "Enter") {
if (popover.isPopover) {
popover.hide();
}
Expand Down
Loading