about summary refs log tree commit diff
path: root/app/javascript/mastodon/components/autosuggest_textarea.js
AgeCommit message (Collapse)Author
2023-02-20Rename JSX files with proper `.jsx` extension (#23733)Renaud Chaput
2023-01-30Upgrade ESlint to v8 (#23305)Nick Schonning
2023-01-24Add lang attribute to compose textarea and CW field (#23240)Claire
Fixes #19858
2020-12-15Change RTL detection to rely on unicode-bidi paragraph by paragraph (#14573)Eugen Rochko
2020-06-02Fix ref attr for react-textarea-autozsize (#13936)Yamagishi Kazutoshi
2019-07-29Fix emoji autosuggestions (#11442)Eugen Rochko
Regression from cfb2ed78231758a79af038a964ab7f7b7b35274e
2019-07-28Add autosuggestions for hashtags (#11422)Eugen Rochko
2019-06-07Fix some React warnings (#10989)Eugen Rochko
2019-06-05Scroll to compose form when focus (#10970)Jeong Arm
* Scroll to compose form when focus * Get rid of constructor
2019-06-02Improvement variable height in single column layout (#10917)Takeshi Umeda
* Improvement variable height of compose and navigation panel in single column layout * Fix wrong quotes and missing commas
2019-05-09Add emoji suggestions to CW and poll option fields (#10555)ThibG
* Refactor selectComposeSuggestion so that different paths can be updated * Add suggestions in CW field * Add emoji suggestion to poll options * Attempt to fix CSS * Hide suggestions by default They will be enabled if the input has focus
2018-04-20Ignore keyevents during text composition (#7205)unarist
KeyboardEvent.key may be physical key name (Escape, Tab, etc.) even in text composition and it causes hotkeys or suggestion selection. So we need to check e.which or e.isComposing. Checking e.which also allows us to avoid Esc key on compositionend in Safari.
2018-04-20Fix Esc hotkey behavior (#7199)unarist
This fixes following cases which causes hotkey action accidentally: * hitting Esc key to cancel text composition (mostly in CJK) Although events on cancelling composition are still heavily browser / input method dependent, but this implementation would covers current UI Events spec and some exceptions. * hitting Esc key to close autocomplete suggestions This PR changes to use keydown event instead of keyup event as well as other hotkeys.
2018-03-04Implement tag auto-completion by history (#6621)Akihiko Odaki
This is a functionality similar to one implemented in Pawoo: https://github.com/pixiv/mastodon/commit/21a3c70f8083b1347d2b8420ed7001b78c2c9620
2017-12-05Add aria-autocomplete='list' in Textaria (#5889)Neetshin
ref: https://www.w3.org/TR/wai-aria-1.1/#aria-autocomplete
2017-10-06Implement hotkeys for web UI (#5164)Eugen Rochko
* Fix #2102 - Implement hotkeys Hotkeys on status list: - r to reply - m to mention author - f to favourite - b to boost - enter to open status - p to open author's profile - up or k to move up in the list - down or j to move down in the list - 1-9 to focus a status in one of the columns - n to focus the compose textarea - alt+n to start a brand new toot - backspace to navigate back * Add navigational hotkeys The key g followed by: - s: start - h: home - n: notifications - l: local timeline - t: federated timeline - f: favourites - u: own profile - p: pinned toots - b: blocked users - m: muted users * Add hotkey for focusing search, make escape un-focus compose/search * Fix focusing notifications column, fix hotkeys in compose textarea
2017-09-24Require at least 2 characters before showing autosuggestions (#5065)Eugen Rochko
2017-09-23Add emoji autosuggest (#5053)Eugen Rochko
* Add emoji autosuggest Some credit goes to glitch-soc/mastodon#149 * Remove server-side shortcode->unicode conversion * Insert shortcode when suggestion is custom emoji * Remove remnant of server-side emojis * Update style of autosuggestions * Fix wrong emoji filenames generated in autosuggest item * Do not lazy load emoji picker, as that no longer works * Fix custom emoji autosuggest * Fix multiple "Custom" categories getting added to emoji index, only add once
2017-09-20Change IDs to strings rather than numbers in API JSON output (#5019)aschmitz
* Fix JavaScript interface with long IDs Somewhat predictably, the JS interface handled IDs as numbers, which in JS are IEEE double-precision floats. This loses some precision when working with numbers as large as those generated by the new ID scheme, so we instead handle them here as strings. This is relatively simple, and doesn't appear to have caused any problems, but should definitely be tested more thoroughly than the built-in tests. Several days of use appear to support this working properly. BREAKING CHANGE: The major(!) change here is that IDs are now returned as strings by the REST endpoints, rather than as integers. In practice, relatively few changes were required to make the existing JS UI work with this change, but it will likely hit API clients pretty hard: it's an entirely different type to consume. (The one API client I tested, Tusky, handles this with no problems, however.) Twitter ran into this issue when introducing Snowflake IDs, and decided to instead introduce an `id_str` field in JSON responses. I have opted to *not* do that, and instead force all IDs to 64-bit integers represented by strings in one go. (I believe Twitter exacerbated their problem by rolling out the changes three times: once for statuses, once for DMs, and once for user IDs, as well as by leaving an integer ID value in JSON. As they said, "If you’re using the `id` field with JSON in a Javascript-related language, there is a very high likelihood that the integers will be silently munged by Javascript interpreters. In most cases, this will result in behavior such as being unable to load or delete a specific direct message, because the ID you're sending to the API is different than the actual identifier associated with the message." [1]) However, given that this is a significant change for API users, alternatives or a transition time may be appropriate. 1: https://blog.twitter.com/developer/en_us/a/2011/direct-messages-going-snowflake-on-sep-30-2011.html * Additional fixes for stringified IDs in JSON These should be the last two. These were identified using eslint to try to identify any plain casts to JavaScript numbers. (Some such casts are legitimate, but these were not.) Adding the following to .eslintrc.yml will identify casts to numbers: ~~~ no-restricted-syntax: - warn - selector: UnaryExpression[operator='+'] > :not(Literal) message: Avoid the use of unary + - selector: CallExpression[callee.name='Number'] message: Casting with Number() may coerce string IDs to numbers ~~~ The remaining three casts appear legitimate: two casts to array indices, one in a server to turn an environment variable into a number. * Back out RelationshipsController Change This was made to make a test a bit less flakey, but has nothing to do with this branch. * Change internal streaming payloads to stringified IDs as well Per https://github.com/tootsuite/mastodon/pull/5019#issuecomment-330736452 we need these changes to send deleted status IDs as strings, not integers.
2017-07-28Improve accessibility (part 3) (#4405)Sorin Davidoi
* fix(compose): Add aria-label for the navigation links * fix(search): Add input label * fix(navigation_bar): Link description * fix(autosuggest_textarea): Add input label * fix(compose_form): Add input label * fix(upload_button): Add input label * fix(account/header): Add link content * fix(column_header): Use h1 tag * fix(column_header): Labels move buttons moving column * fix(settings_text): Add label to input * fix(column_header): Remove role from h1 * fix(modal_root): Use role=dialog * fix(modal_root): Focus restauration * fix(modal_root): Apply inert to sibligs * fix(column_header): Add role=button * chore(eslint): Disable jsx-a11y/label-has-for
2017-06-23Use Class and Property Decorators (#3730)Yamagishi Kazutoshi
ref https://tc39.github.io/proposal-decorators/
2017-06-07fix(components/autosuggest_textarea): Race condition regarding onBlur (#3631)Sorin Davidoi
2017-06-06Improve ESLint rules for JSX (#3608)Yamagishi Kazutoshi
* Add react/no-string-refs ESLint rule * Add react/jsx-boolean-value ESLint rule * Add react/jsx-closing-bracket-location ESLint rule * Add react/jsx-indent ESLint rule * Add react/jsx-curly-spacing ESLint rule * Add react/jsx-equals-spacing ESLint rule * Add react/jsx-first-prop-new-line ESLint rule * Add react/jsx-no-duplicate-props ESLint rule * Add react/jsx-tag-spacing ESLint rule
2017-05-26Introduce react-textarea-autosize instead of using style.height side effects ↵Eugen Rochko
(#3334)
2017-05-24Remove unnecessary constructors (#3280)Yamagishi Kazutoshi
2017-05-20Improve eslint rules (#3147)Yamagishi Kazutoshi
* Add semi to ESLint rules * Add padded-blocks to ESLint rules * Add comma-dangle to ESLint rules * add config/webpack and storyboard * add streaming/ * yarn test:lint -- --fix
2017-05-19Avoid useless renders (#3141)Sorin Davidoi
* feat(eslint): Set react/jsx-no-bind: error * refactor(notifications/setting_toggle): Do not use bind * refactor(components/dropdown_menu): Do not use bind * refactor(components/autosuggest_textarea): Do not use bind * refactor(compose/privacy_dropdown): Do not use bind * refactor(compose/upload_form): Do not use bind * refactor(components/status): Do not use bind * refactor(components/onboarding_modal): Do not use bind * refactor: PR feedback * chore(notifications/setting_toggle): Lint * refactor: PR feedback
2017-05-19Replace inline styles with stylesheet (#3115)Yamagishi Kazutoshi
2017-05-14Fix only typo (#3035)Paul
2017-05-12Use ES Class Fields & Static Properties (#3008)Yamagishi Kazutoshi
Use ES Class Fields & Static Properties (currently stage 2) for improve class outlook. Added babel-plugin-transform-class-properties as a Babel plugin.
2017-05-10Disabled auto focus on toot form when search results are shown. (#2942)fusshi-
2017-05-03Replace sprockets/browserify with Webpack (#2617)Eugen Rochko
* Replace browserify with webpack * Add react-intl-translations-manager * Do not minify in development, add offline-plugin for ServiceWorker background cache updates * Adjust tests and dependencies * Fix production deployments * Fix tests * More optimizations * Improve travis cache for npm stuff * Re-run travis * Add back support for custom.scss as before * Remove offline-plugin and babili * Fix issue with Immutable.List().unshift(...values) not working as expected * Make travis load schema instead of running all migrations in sequence * Fix missing React import in WarningContainer. Optimize rendering performance by using ImmutablePureComponent instead of React.PureComponent. ImmutablePureComponent uses Immutable.is() to compare props. Replace dynamic callback bindings in <UI /> * Add react definitions to places that use JSX * Add Procfile.dev for running rails, webpack and streaming API at the same time