Expanding and Shrinking Panels through Touch in GWT

I have created a flexible panel using GWT and found inspiration from the following post,

GWT resizable panel

To see a demo of this in action, visit my hosting on AppEngine:

I am seeking assistance in enabling touch events for resizing the Panel. I aim to make it work on iPad and Android Tablets as well, but so far, it's not functioning properly. On iPad, touching the Panel results in selecting the entire Panel. I have tried using the following CSS properties:

-webkit-user-select: none;
-webkit-touch-callout: none; 

However, the issue persists. This same problem occurs with the VerticalSplitPanel in Roughian GWT Examples. You can find it here,

Any guidance or support would be greatly appreciated...!

Answer №1

To manually remove the selected range, you can start by capturing the browser event and then proceed to eliminate all ranges from the DOM. After that, you can handle other events accordingly. Here is an example code snippet to achieve this:

var sel = window.getSelection();
var range = sel.getRangeAt(0);
sel.removeAllRanges();

Answer №2

After some trial and error, I was able to solve the issue on my own. I simply incorporated touch events in a similar manner to how I included mouse events.

Here is the mapping I used:

  1. MOUSE DOWN --- TOUCH START
  2. MOUSE UP --- TOUCH END
  3. MOUSE MOVE --- TOUCH MOVE
  4. ON LOSE CAPTURE --- TOUCH CANCEL

Next, I made sure to add sink events to my touch events as well:

this.sinkEvents(Event.MOUSEEVENTS | Event.ONLOSECAPTURE | Event.TOUCHEVENTS | Event.ONTOUCHCANCEL);

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How can I display a modal exclusively on a specific screen size?

Having a situation where two components are involved. The first component has an ng-click function that triggers a modal containing the second component. Currently, everything is working smoothly. However, the issue arises when the modal should only open a ...

How can jQuery be used to style a single selected option with a unique color?

I have a dropdown menu with a default placeholder ("ex. Crawler Excavator") displayed in lightgray. I want only this placeholder to be in lightgray when selected, while all other labels should be black. Currently, I am able to color the selected item light ...

What is the best way to remove column and row gaps in a Bootstrap grid system?

Despite adjusting padding with the image, div section, and grid gap to 0px in the grid layout, the image still fails to cover the entire cell. I am seeking a solution to eliminate these unwanted paddings that are highlighted in blue. The Bootstrap 5 .g-0 ...

Top method for removing quotation marks from form input using jquery

Here is a form input that I need to handle: <tr class="formulaRow"> <input type="text" class="ingredient required" name="ingredient"> </tr> Currently, the value from this input is stored as follows: var ingredient = $(".formulaRow").fi ...

How to intercept a post request from JavaScript in a JavaFX WebView

Exploring JavaFX for the first time has brought me to the intriguing WebView class. I am interested in using it to locally host an HTML5 site as the front end for a desktop application. I have a question regarding ajax requests made from JavaScript within ...

Choosing siblings of a particular element that meet certain criteria

I am faced with the following situation: <table> <tr class="header"> <tr class="data1"> <tr class="data2"> <tr class="data3"> <tr class="header"> <tr class="data1"> <tr class="data2"> </tabl ...

jquery: centralizing progressbar growth on the page

Working with Bootstrap progress bars is a regular task for me, and I have included a small example below. var $progress = $('.progress'); var $progressBar = $('.progress-bar'); var $alert = $('.alert'); setTimeout(function() ...

What is the process to discover, upload, and implement a custom font?

In my quest to locate and incorporate a font named neontubes, or if not available, a font called freestyle script, I have learned that I must obtain an src which is then included in my style.css file and subsequently designated in the styling rule like s ...

Ways to position the second section below the button

Is there a way to make a section of my website where, upon pressing a button, the button moves to the left and reveals collapsed text that appears below it with some padding on top? I've been trying to achieve this as a beginner by looking through doc ...

Symbol placed atop text within a navigation bar

I am in the process of creating a custom menu for my website. I want to include an icon with text underneath, but when I add the text it shifts to the right and messes up the alignment. Menu with Icon Only Menu with Text (causes alignment issues) @impo ...

Setting a variable equal to user input

When using a jQuery script, the elements for the details are dynamically created inside a jQuery function. However, there seems to be an issue with assigning the value from the variable "startLocation" to the input "detail_startLocation[]". Only the firs ...

Populate HTML Table with Array Elements

I need assistance with inserting array values into an HTML table. The table should have 5 columns and enough rows to accommodate all the information. I envision it looking like this: 1 | 2 | 3 | 4 | 5 11 | 22 | 33 | 44 | 55 111 | 222 | 333 | 444 | 555 ...

Is it possible to include ternary in the "homepage" section of the package.json file?

When making API calls in production, they will be on the same domain as where my app is hosted, so it's necessary to include "homepage": "." in the package.json. However, when working locally from localhost, I need to make API calls to the production ...

CarouFredSel Transition Troubles

I am currently using CarouFredSel to create an image carousel, but I am encountering some issues with the transitions between items. My goal is to incorporate simple HTML elements into the carousel instead of just plain images. However, when I attempt to ...

React drag and drop feature now comes with autoscroll functionality, making

I am encountering an issue with my nested list Items that are draggable and droppable. When I reach the bottom of the page, I want it to automatically scroll down. Take a look at the screenshot below: https://i.sstatic.net/ADI2f.png As shown in the image ...

What is the best method to ensure a TALL table header is repeated on every page in Chrome?

First time poster =) I am currently facing an issue while trying to print a long table and have the table header repeat on each page. The problem arises when the height of the <thead> reaches a certain threshold, specifically 242px in Chrome 87.0.42 ...

Update the font style of the navigation bar

Hey there! I recently downloaded a template from this website: . However, I'm facing an issue with the nav bar displaying strange fonts when using Vietnamese letters. For example, "Nước" shows up as all uppercase and the letters "uo" are shortened. ...

Can you explain the purpose of including text-rendering: optimizeLegibility in a CSS stylesheet?

Can you explain the significance of setting text-rendering to optimizeLegibility in a CSS file? For example, like this: html { text-rendering: optimizeLegibility; } ...

Go to a distant web page, complete the form, and send it in

As the creator of Gearsbook.net, a social network for Gears of War players, I am constantly striving to improve the site's functionality. Currently, it is quite basic and in need of updates. One highly requested feature by users is the ability to lin ...

Why @font-face doesn't display on older versions of Internet Explorer like IE 7 and IE

Our website has the following CSS code. The use of a smiley face is to ensure compatibility with IE 7 and IE 8. However, while the site's fonts display correctly on IE 9, Chrome, Firefox, etc., there seems to be an issue with IE 7 and 8. @font-face { ...